use QSocketNotifier, not poll

also use appnope context manager to disable App Nap on OS X 10.9.

Adds IPKernel._darwin_use_appnope flag, so that it can be disabled, in case app nope causes problems for some.
add appnope to external