Fix prompt in 'detached HEAD' mode by using $pipestatus to check the exit status of command executed before pipe. Fixes #5