Fix O_* flags for Darwin. Minor kqueue tweaks.