Clarified thread safety statement.
Confined remaining functions to main thread.
Removed superfluous cast.
Fixed MinGW detection.
Merge remote-tracking branch 'upstream/master'