Guard `std::FILE*` to avoid resource leak