Remove dependency on src/ from lib/sdl and lib/qtgame, and one dependency from framework
Fix one last dependency from framework to src/, and fix a possible race condition in error reporting.