Handle exit message from window manager on Linux

The examples not closing properly when using the window manager to exit them was frustrating me. :D