ENH: add a 'return_counts=' keyword argument to `np.unique`

This PR adds a new keyword argument to `np.unique` that returns the number of
times each unique item comes up in the array. This allows replacing a typical
numpy construct:

    unq, _ = np.unique(a, return_inverse=True)
    unq_counts = np.bincount(_)

with a single line of code:

    unq, unq_counts = np.unique(a, return_counts=True)

As a plus, it runs faster, because it does not need the extra operations
required to produce `unique_inverse`.
refactored code: if `unique_counts` is requested, but neither `return_index`
nor `return_inverse` are, there is no need to call `argsort`, and the counting
of unique items can be sped up a lot.
Added versionadded tags in docstring
BUG: Added fixes to unique in #4344 (fixes #2799)