Wrap writev system call for unit testing.