gcc-changelog: remove file descriptor leaks
Currently, running gcc-changelog's unit tests may clutter the output
with tons of warnings such as:
.../contrib/gcc-changelog/git_email.py:40: ResourceWarning: unclosed
file <_io.TextIOWrapper name='/tmp/tmpt5okd4qp.patch' mode='r'
encoding='UTF-8'>
lines = open(self.filename).read().splitlines()
ResourceWarning: Enable tracemalloc to get the object allocation
traceback
This commit fixes these leaks, which restores a clean testsuite output.
contrib/
* gcc-changelog/git_update_version.py: Close file objects after
use.
* gcc-changelog/git_email.py: Likewise.
* gcc-changelog/test_email.py: Likewise.