version-gen.sh: Ensure only collectd repository versions are used

When cross compiling in hosted environments using RPM,
the extracted tar-ball can be located in a parent .git repository.

The version-gen.sh script will then take the version number from
this repository as if it represents collectd.

This can be even more erroneous when the version returned is non
numerical and breaks the build

Signed-off-by: Kieran Bingham <kieran.bingham@st.com>