Steps to reproduce:
1. Create a project with a README
2. In the actual remote, type: `git symbolic-ref HEAD refs/heads/nowhere`
3. Check that HEAD is gone via `git ls-remote .`
4. Go to the projects page and see the Error 500
Closes https://github.com/gitlabhq/gitlabhq/issues/9484
The previous behavior was, that the first element of the select was
preselected, thus upon saving the project, the previous selected could
be overwritten.