testhelper: Add simple race-free way to retrieve umask
Several of our tests implicitly depend on the host umask. But because the umask is process-wide, figuring out the umask at test execution time is non-trivial when tests run in parallel. We currently work around this issue by simply not running any such tests in parallel, but that is not exactly great.
Let's fix this issue by introducing a new testhelper.Umask()
helper.
At startup, we pre-determine the umask and cache it so that it becomes
safe to ask for the umask even in parallel tests. As our tests are
expected to not modify global state this should be a safe thing to do.