Support git repos not on a branch in state_git
Fixed deep cleaning of builds (and --skip-build / unsetting of env)