(MODULES-660) Correct detached HEAD on latest

Previously vcsrepo detached HEAD on checkout which caused further branch
revisions to fail. This corrects the behavior, and works on git 1.7,
1.8, 1.9, and 2.0
Merge pull request #173 from hunner/mod_660

(MODULES-660) Correct detached HEAD on latest