Improve input extension focus handling with multiple master devices
* src/xterm.c (x_cache_xi_devices): Initialize device fields to
0.
(xi_handle_focus_change, xi_focus_handle_for_device)
(xi_handle_delete_frame): New functions; store focus information
per-device instead.
(x_detect_focus_change): Handle GenericEvents that way instead.
(handle_one_xevent): Don't cache XI devices on DeviceChanged.
(x_free_frame_resources): Clear any frame focus information.
* src/xterm.h (struct xi_device_t): New fields for focus
tracking. Add comments describing fields.