REF: implement get_unit_from_dtype
Finding I need this in a bunch of non-nano branches.

cpplint gave a warning I didn't know what to do with so ignored; pls advise.
```
pandas/_libs/tslibs/src/datetime/np_datetime.c:787:  Are you taking an address of a cast?  This is dangerous: could be a temp var.  Take the address before doing the cast, rather than after  [runtime/casting] [4]
```

@mattip would this be a good candidate for adding to numpy's `__init__.pxd`?
>  I guess if the cpplint warning can't be address in the near team

should have mentioned, fixed that in a subsequent commit, so we're all good. Thanks @jbrockmendel 