gitserver: Remove bad ref HEAD after clone and fetch
Created by: keegancsmith
Git produces warning output when a repository contains a reference or tag HEAD. Repositories shouldn't contain these tags or refs, but bad repositories exist leading to our tooling breaking due to unexpected output. To avoid this problem we remove the problematic refs on fetch/clone.
Test plan: unit tests
Fixes https://github.com/sourcegraph/sourcegraph/issues/5291