The end function of write stream must be called. Moreover, package is done
only after output stream fired end function callback.

The stream may stay open otherwise and prevent file delete.