Fix warnings.
Cleanup nested if.
Log errno and exit if `kevent` fails.
Add an autorelease pool.

See https://github.com/quicksilver/Quicksilver/issues/1521#issuecomment-21868777 for the rationale.