Add explicit ScopedLock.
Add -pthread
Extract UserInput from SDLGui.