Avoid possible test failures from reopening files just unlinked

See previous commit for details.