Fix warnings about deprecated function XKeycodeToKeysym.

Use XGetKeyboardMapping instead.