Fixed issues with kqueue and made it default on systems that support it