This avoids "./" being part of the tar. "./" translates to the
systemroot / when we extract, and this is problematic since tar cannot
change permissions and ownerships of this folder. tar 1.34 gives an
error:
tar: .: Cannot change mode to rwxr-xr-x: Operation not permitted
tar: Exiting with failure status due to previous errors
when we try to extract the data.tar.xz.
By moving the checks we can make the function more general, and
thereby re-use it for creating subpackages and potentially hostbuild
tools packages.
tests: building libandroid-support and build-essential.