Fixes the sed command and adds back the * for dirty.

The latest git changed the git status from showing "nothing to commit,
(working directory clean)" to "nothing to commit, working directory
clean".
The fix also includes updating the parsing of the git status message to
stay in line with latest git message.

Tested with Mac OSX 10.9 and git version 1.8.5.3