.bash_prompt: Speed up the Git commands for the prompt

Fixes #227 and closes #380.