Rework NS event handling (bug#25265)
* src/nsterm.m (unwind_apploopnr): Remove.
(ns_read_socket): Remove references to apploopnr. Make processing the
NS event loop conditional on being in the main thread.
(ns_select): Remove references to apploopnr. Remove all fd_handler
related stuff. Check if there are events waiting on the NS event
queue rather than running the event loop. Remove unused variables and
code.
(fd_handler): Remove.
(ns_term_init): Remove creation of fd_handler thread.
(hold_event, EmacsApp:sendEvent, EmacsView:mouseMoved,
EmacsView:windowDidExpose): Remove send_appdefined.
(ns_send_appdefined): Always check the event queue for
applicationDefined events rather than relying on send_appdefined var.
* src/nsterm.h: Remove reference to fd_handler method.