Backport of the standard library's contextlib module to earlier Python versions.