spec/config: Keep track of the tempfile and close it manually (fix spec flakiness)