(iOS) Add more safeguards in apple_touch_event and apple_input_keyboard
event