Make sure test dir is accessible to everyone when running unsafe tests

(cherry picked from commit 7806cbda33f0aabf29b67b8dd6942ea58c72c632)