Fix bug in readv() and fread()

readv() takes a pointer to *const* iovecs, meaning it isn't allowed to change
them. Unfortunately, our internal read implementation did modify the iovecs,
zeroing their length field. It turns out that this non-conformity with the
standard also breaks our fread() implementation, which uses readv() and
assumes it doesn't touch the iovec's lengths, so without this patch fread()
with large enough lengths will return garbage.

Interestingly, the compiler should have warned us about writing to a const
field, except we had an explicit cast (!) removing the constness. Yuck.

The solution is to copy the iovecs in sys_read (the new vector is allocated
on the heap). Interestingly, the existing code already used a silly function
"copyinuio" which allocated the "uio" structure on the heap, which we didn't
need to do, and forgot to copy the iovec, which it needed to. So use correct
inline code instead of the useless copyinuio().

Fixes #354.

In separate patches I will provide a test case for this bug, and also the same
patch for writev() and perhaps other users of copyinuio().

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>