BUG: write_exe was not closing the file handle.

This 'worked' ok on CPython because of immediate reference counting
semantics, but was broken on pypy.