Fix Oracle provider thread safety issue, fix LoadReferencesJoinTest on O...

...racle.

Also separate out timestamp conversion/hacking code so I can duplicate it elsewhere easily and know it is the same.