setup_temporary_shallow: avoid using inactive tempfile