appkit: Add some methods useful for waking up event loops from other threads

r? @metajack