requires: re-use vfs.tryread for simplicity
Avoids calling `set` twice or having to re-raise an exception and implements the routine with a single return expression.
## Avoid interference from actual test env:unset HGTEST_JOBSunset HGTEST_TIMEOUTunset HGTEST_PORTunset HGTEST_SHELL