Add cleanup function Stop for Linux.
Add better error handling for SwapBuffers on Linux.
Add callback for handling unexpected errors.