Fix *BSD support for terminal colours
Simplifiy git working tree detection

Thanks to @pkkolos (Panayiotis Kkolos <pkkolos@gmail.com>) for the inspiration.
https://github.com/pkkolos/liquidprompt/commit/63e1b8229ba122de3db4c747704d5a13a4b4a109