Small corrections from review comments
Small corrections from review comments

Remove remaining legacy code.
Separating untar file writing to be able to use defer for closing.

dimitern/utils,rogpeppe/juju-utils