Improved synchronisation between renderer and update thread

Synchronisation is done using signals instead of mutexes.
The thread manager keeps track of all the created signals and
wakes up all the waiting threads to make sure the application
terminated properly.