iw: version.sh: update to get version with git correctly
iw: version.sh: update to get version with git correctly

update to get the version information from the
git repository where this file is located instead of the
the current directory where it is executed, otherwise if
there is .git directory in the current directory, it will
get the wrong version information.

And improved the version check since the tag information
may not be mirrored like what AOSP does now.

Signed-off-by: Yongqin Liu <fc452534e2bb14e62a523a8ce75c55834a16723b@linaro.org>
Signed-off-by: Johannes Berg <bff32994ff0f8d048f262a8388145a71b6071bfe@intel.com>

bw-oss/iw,greearb/iw-ct,greearb/iw-ct,bw-oss/iw