Always emit close after all parts ended

This makes sure to track the end of all emitted parts and delay
the close event until all parts have been consumed.

fixes #36