Update HEAD pointer in bare repo when changing default_branch

Resolves: #3314, #2572