Parse date/time in a locale independent manner

Creates a new threadsafe context manager to temporarily reset locale so that
strptime behaves as desired. Fixes #2271.
Reset locale after test run
Merge pull request #2317 from danielgtaylor/ts-locale

Parse date/time in a locale independent manner. Fixes #2317, #2271.