Use fresh file for every test
Ensure file mode is always set
Fix chmod(000) if "perms" member is left uninitialized
Rewrite test to not rely on timing anymore