BUG: pd.unique should respect datetime64 and timedelta64 dtypes (GH9431)
To fix [GH9431](https://github.com/pydata/pandas/issues/9431).

Previously `pd.unique` would return an array of  `object` dtype when passed a 1D array, Series or Index with a `datetime64` or `timedelta64` dtype. This PR should remedy that behaviour.

I can add the extra tests and make the changes there, no problem.

I did originally put the `if`/`else` logic in `_hashtable_algo`. There it works great for `unique`, but I realised it messed up `pd.match` for datetime64 arrays (which also calls `_hashtable_algo`). Here instead of returning an array of integer indices, `pd.match` returns a view of those indices as datetime64 because `_hashtable_algo` is only told what hashtable needs to be built, not what the dtype of the returned array needs to be. 

Putting the logic in `pd.unique` itself looked to be by far the most straightforward way to solve this, but I'm happy to try and see if any other approaches are viable.
 @ajcr `.match` looks up using an `ObjectHashTable` for non-integer/float, (changing is trivial for `datetime64/timedelta64` but prob not worth the effort.

So add a return type to `_hashtable_algo` and have it do the casting
 @jreback thanks for the guidance - I've made changes to the tests and to `_hashtable_algo`. Happy to do more work if anything should be improved further.
 @jreback I fixed the variable name and everything's green - as ever, please do let me know if there's anything more I should do.
 @ajcr thanks!

its funny that these didn't exist, though people just use `.unique()` method on `Indexes`, but this is nice for compat
