Fix PROMPT_COMMAND setGitPrompt cumulation when re-sourcing gitprompt.sh

Repeated calls of:
    source .bash-git-prompt/gitprompt.sh
lead to cumulation:
    PROMPT_COMMAND=setGitPrompt;setGitPrompt;...
rendering everything slow
Merge pull request #55 from Bost/prompt-command

Fix PROMPT_COMMAND setGitPrompt cumulation when re-sourcing gitprompt.sh
Move last little bit of script into a function so local is available
Merge pull request #56 from erikpukinskis/master

Move last little bit of script into a function so local is available
Fix an error when opening a new tab from terminal

Opening a new tab from a terminal where the current path is not $HOME I get the following error :

```
bash: .bash-git-prompt/gitprompt.sh: No such file or directory
```
Merge pull request #58 from a14n/patch-1

Fix an error when opening a new tab from terminal