fixed naked tar detection to look for magic number. Fixes #6868

This change offers better detection of tar archives by using the tar [magic number](http://en.wikipedia.org/wiki/List_of_file_signatures) instead of regex. Fixes a problem I encountered with a "naked" tarball url.