Simplify the logic for updating OP_WRITE in the NIO transport

- Removed code duplication