Use git fetch to fix gitcache missing branch.

There exists a problem when the checkout process uses a cache that is old
and fails due to trying to checkout a branch that does not exist in the cache.

To fix this do a git fetch before the checkout to sync the branch heads.