tar: flatten the pseudo-tree only after readHeaders() is done
tar: flatten the pseudo-tree only after readHeaders() is done

Flattening within the readHeaders() function call was problematic
because readHeaders() is called as a goroutine; thus, as the
main program was calling `tdh.writeTo(os.Stdout)`, readHeaders() was
still in the process of flattening the tree structure. To get around this,
we now call flatten in ts.Hierarchy(), such that only when the main program
is ready to retrieve a "valid" DirectoryHierarchy from the archive, should
we flatten the tree.

Signed-off-by: Stephen Chung <dfcd4e1043ff9779fc85be4e40636ec800ab4d59@redhat.com>

vbatts/go-mtree,vbatts/go-mtree