Fixed the X11 exiting error.

Now can gracefully close a X11 window. Also can press q or Q to quit, this is not necessary though.