vfs:  Plug potential memory leak

If copying value requires memory allocation, it could throw an exception
and leak the filehandle.