Don't close until the compress is done.

Thanks @magicseth