t9903: add tests for git-prompt pcmode

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

Add tests for:
* prompt without color
* prompt with colors in bash
* prompt with colors in zsh

Having these tests will enable an upcoming refactor
in a safe way.
git-prompt.sh: refactor colored prompt code

Remove duplication of logic to build gitstring.

__git_ps1_colorize_gitstring() sets color codes and
builds the prompt gitstring. It has duplicated code
to handle color codes in bash and zsh shells.
__git_ps1() also has duplicated logic to build the
prompt gitstring.

Remove duplication of logic to build gitstring in
__git_ps1_colorize_gitstring() and __git_ps1().

Leave in __git_ps1_colorize_gitstring() only logic to set color codes.
git-prompt.sh: enable color prompt in non-pcmode

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.