Extract the `suppress_oserror()` function from the ObjectManager and make it available as utility for other code as well. This also adds a bunch of tests that verify it works as expected.