wait for tar to complete when closing stream in

This fixes a nasty race that allowed clients to continue on as tar was still extracting in the background.