BUG: use stable sort for group_index in groupby
Following on https://github.com/pydata/pandas/pull/8128, for certain `groupby` operations such as, 

```
df.groupby(key)[col].transfrom('first')
```

it is necessary to use stable sort for group indices. As a result, `numpy.argsort` should be called with argument `kind='mergesort'`.

can u put in a test to validate this (eg that fails w/o this fix)
 I made two _dummy_ commits (will revert them later). Both _force_ the code to always use `argsort` by changing [this line](https://github.com/behzadnouri/pandas/commit/6d278bdaa89332c1ba55db9f4af5c3553d805310#diff-720d374f1a709d0075a1f0a02445cd65R3572) to `if False:`. The one which uses quick-sort fails the Travis build. The other one which uses a stable sort (merge-sort), passes the tests.

However, I was not able to make a test for the original commit, which goes through `argsort` path (i.e. multi-key with large number of keys combinations) and it generates wrong result if we do not specify `kind='mergesort'`. Whenever it _does_ use `argsort`, even with a quick-sort kind, the results looks valid to me.

My best guess is that it has something to do with the group indexer being compressed or not.
 ok, need to come up with a test that fails with the original method (if you can). if you can't I don't have a problem changing this as `mergesort` is stable. but lmk.
 I tried a lot but I could not make a test which fails with the original method. I am _almost_ convinced it would not fail, but it is safer to specify `mergesort`. Later if I have time, I would dig more into this.
 ok, lmk when you are ready then (and rebase away those dummy commits). no hurry.
 removed the dummy commits; travis links for the record:
[quick sort travid build](https://travis-ci.org/pydata/pandas/builds/33990455)
[merge sort travis build](https://travis-ci.org/pydata/pandas/builds/33991596)
