Only release buffer after file has been closed. Fixes #800824. Will backport to 2.2.
Only release buffer after file has been closed. Fixes #800824.
Will backport to 2.2.

sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator