Fix and simplify version matching for running tests

The version strings that might need bumping for releases and branch
forks are now all maintained in one place, and are always
defined. Correct behaviour follows from whether the "-dev" tag is
present in PROJECT_VERSION.

When this patch is merged with master branch, preserve the bump
to PROJECT_VERSION that is already in master branch, and change
release-5-0 to master branch for REGRESSIONTEST_BRANCH.

Change-Id: I4a5579f00e487273f8e08bad5613ecceac7bf682