Part of #4196.
-Fix memory corruption due to using wrong singleton in multithreaded physics, fixes #2760