Fixed joystick segfault programs (race condition on whether main thread or js thread exits first...knew there should have been a mutex from the beginning). Needs to be tested on windows...but none of the underlying implementation changed...just the main class stuff...so it should be good...but it should be tested anyways...