BUG: fix groupby segfault on MultiIndex issue #2706