iplib: Support O_NONBLOCK in helper functions