write/pwrite fix