Workaround lack of `__exit__` on Python 2 mmap's
Workaround lack of `__exit__` on Python 2 mmap's

Appears that mmap in Python 2 lacks context manager support. So it
cannot be used in `with` statements. This functionality exists in Python
3 (was added in Python 3.2). As a workaround, use `contextlib.closing`
to effectively make `mmap` work in a context manager. This fix works
nicely on both Python 2 and Python 3 while maintaining the same syntax.
Has the basically same effect as Python 3's native context manager
support.

ref: https://bugs.python.org/issue8046

DudLab/nanshe_workflow,nanshe-org/nanshe_workflow