Improve regexes in utils/git.py
Make utils.system.cd thread safe