Partially fixes running the test suite with sudo ninja test, or on a build machine where the builds are run as root.
sudo ninja test