[API][GTK] Use Xlib to implement global hotkey. Part of #200.

1. Use XGrabKey and XUngrabKey to implement global hotkey.
2. Refactor the code for better cross-platform.