Backout changesets f309dacf4010:be3cef4b69e3 for thread safety assertions on Windows and test failures on OSX.
Merge backout.