Include -devel-HASH(-dirty) in the version string

When not compiled with `make RELEASE=1`, the version string will include
a suffix with the exact version information based on the git hash. Also,
if the current working tree is dirty (it have uncommitted changed) an
extra suffix will be added (-dirty).

When using `make RELEASE=1` only the version information present in the
VERSION file will be used.
Merge pull request #1737 from leandro-lucarella-sociomantic/devel-version

Include -devel-HASH(-dirty) in the version string
remove never-true code
Merge pull request #1600 from braddr/cleanup

Isolate CFseg usage in common code