TST: regression test for groupby with datetime and timedelta (#15562)
- [X] closes #15562
- [X] tests added / passed
- [X] passes `black pandas`
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

This change doesn't add a new feature but adds an regression test for #15562 which has been fixed with pandas 0.20. Hence there is no whatsnew entry.

The bug was reported for pandas 0.18.1 and persisted until 0.19.2 but was fixed in 0.20.0(-rc1). I managed to reproduce the error (with `numpy==1.12.1` on python 3.6, otherwise some errors unrelated to this bug appear).

I added an regression test to `pandas/tests/groupby/test_apply.py` and verified that the code will fail with 0.19.2 and succeed with 0.20.0 and master.

I wasn't able to further reduce the test provided by @field-cady.