Fix a bug introduced in 1.43.0 where a file (`providers.json`) was never closed. Contributed by @arkamar.