Add workaround for tests on SELinux systems.

SELinux systems may have the security.selinux attribute defined for
temporary files upon creation. This can cause problems for the tests,
which assumed that new files have no attributes. Therefore, a few
hacks are necessary to get tests to pass in this case.