fix O_SYNC|O_APPEND syncing the wrong range on write()