[BUG] Sum of grouped bool has inconsistent dtype
- [x] closes #7001
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Would appreciate any feedback on this attempt.

The strategy is to modify the dtype after the aggregation is computed in certain cases when casting. In order for this to work, the cast functions need to be made aware of how the data was aggregated. I've added an optional "how" argument to maybe_downcast_numeric and _try_cast. Because this dtype change is needed in two places, I've added the function groupby_result_dtype to dtypes/common.py to handle the logic.

I wasn't sure where the mapping information needed by groupby_result_dtype should be stored. Currently it is in the function itself, but maybe there is a better place for it.

If this is a good approach, it could potentially be expanded for other aggregations and datatypes. One thought is that perhaps groupby(-).mean() should always return a float for numeric types.
@rhshadrach if you can update @jreback Failure is unrelated, ready for another review:

``
##[error]./pandas/tests/indexes/timedeltas/test_constructors.py:173:String has a space at the beginning instead of the end of the previous string.
`` @jreback ping @jreback ping @jreback ping very nice @rhshadrach keep em coming!
 Thanks for the feedback @jbrockmendel. I'll clean these type hitns up in a subsequent PR. > I'll clean these type hitns up in a subsequent PR.

FYI mypy error:  `pandas\core\dtypes\cast.py:333:18: error: "type" has no attribute "_from_sequence"`

so maybe worth adding type hints to `maybe_cast_to_extension_array` and add a subclass check to the instance check 
