ENH: add bounds-checking preamble to groupby_X cython code
continues #3017, does an easier bit under #3028

Added fix for #3035 
 merging soon, if no comments.
 Added sanity checks to cython groupby agg function. still - merging soon.
 merged.
