added another optimization for writev and a test for it