t9903: Add tests for git-prompt pcmode.

git-prompt.sh was missing tests for PROMPT_COMMAND mode.

Add tests for:
* prompt without color
* prompt with colors in bash
* prompt with colors in zsh
git-prompt.sh: refactor colored prompt code.

Remove logic to build gitstring out of __git_ps1_colorize_gitstring()
and leave only color coding logic.
The logic to build gitstring in __git_ps1() for non-colored prompt is
now also used for colored prompts.
git-prompt.sh:

The use of colors in a prompt is only possible in pcmode (using
the variable PROMPT_COMMAND).

Make color prompt work in non-pcmode (using the variable PS1)
for both Bash and ZSH.