Add unique(AbstractArray, dim)

Efficiently finds the unique columns, rows, etc. of an array. The
algorithm first hashes each row, then finds the unique hashes, and
finally checks that the hashes don't collide. It is roughly O(n) in
the number of elements in the matrix.

This is my first time using Cartesian. Without it, this code is
presently about 10% faster for finding unique rows of a matrix, but
the overhead is probably worth it for the generality.
unique(AbstractArray, dim): incorporate @timholy's suggestions
Merge pull request #5811 from JuliaLang/sjk/uniquedim

Add unique(AbstractArray, dim)