Added branch-alias to version output when it is aliasing dev-master

Added branch-alias for dev-master to ```--version|-V``` output when current version is actually a revision (a non release/git tag).
This replays the work done in #3352 taking care about other uses of ```Composer::VERSION``` constant (for instance ```diagnose``` and ```self-update``` commands).

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| Doc PR        | none