Only apply O_NONBLOCK hack on Darwin

This hack should only be applied when necessary.