branchmap: use a context manager when writing the branchmap
This is cleaner and safer. The previous code date from long before we had context manager available.
Edited by Pierre-Yves David
This is cleaner and safer. The previous code date from long before we had context manager available.