prevent state from changing from head to installed

allows for --HEAD to be included in brew install command
Merge pull request #6554 from vyrak/keep-head-state

homebrew: state=head includes --HEAD