Save branch head to a buffer variable

Save branch head to a buffer-local variable to prevent looking up the VCS head for every status line refresh.