Properly closing filedescriptors.
Fixed crash when win/lose game.
Showing game messages in example app is working.
Some cleanup.