Implemented the posix::write() utility function.