FIX: Fix some instances where idx[0] not in idx
`DatetimeIndex.__contains__` and `TimedeltaIndex.__contains__` were failing to see duplicated elements in some circumstances.

Fixes #9512

awesome!

can you add a release note to the bug-fixes section of `doc/source/whatsnew/0.16.0.txt` and squash the commits into one?
 merged via #9525. Thanks!
