compile_pkgs: report correct git revision/version for OpenWrt
This moves version file generation right after clean. This ensures that we really report OpenWrt hash and not our patch commit that is created to extend ignore list.
This also uses different git command that has lower overhead and is intended more for this kind of operation.
This should fix base-files reinstall with every new build.