fs: do not throw exception after creating FSReqCallback
Once an FSReqCallback
instance is created, it is a GC root until
the underlying fs operation has completed, meaning that it cannot
be garbage collected.
This is a problem when the underlying operation never starts because an exception is thrown before that happens, for example as part of parameter validation.
Instead, move all potentially throwing code before the FSReqCallback
creation.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines