Fix permission denied messages from building PS1 when on a detached head

prompt_git:22: permission denied: