[~] fix plugin pj

https://github.com/robbyrussell/oh-my-zsh/commit/bce74975d055529cbd186782e2fd99e6da840460
Switch back to oh-my-zsh.hide-dirty setting again

Commit 81004dfaba509ff62a13ba303ab941938d619326 reverted the change
in 9b811fb625c03c30a766191cdf65a1c7c1fd96b2 when editing the merge
conflict from #2928.

This commit fixes that so that we don't make the same mistake again.

First seen in http://git.io/Cdaj5Q
Merge pull request #3323 from alfss/fix-pj

[~] fix plugin pj
Merge pull request #3333 from mcornella/fix-git-hide-dirty

Switch back to oh-my-zsh.hide-dirty setting again
Refactor similar functions into common sections
Fix take function

Before the modification, the `take` function will try to cd
into the created directory even if mkdir throws an error.

With this modification, if mkdir fails to create the directory,
cd won't run and the take function will return the mkdir exit
code.