BUG: fix groupby crash on duplicated columns (GH7511)