git-prompt.sh: refactor colored prompt code

__git_ps1_colorize_gitstring() sets color codes and
builds the prompt gitstring. It has duplicated code
to handle color codes for 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).

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