fix($location): fix handling of hash fragment links

This commit adds a new `fixHashFragmentLinks` method to `$locationProvider`. This method fixes incorrect rewriting of hash fragment links. In order to use in your project, you need to enable the new behavior:

```js
myApp.config(function($locationProvider) {
  $locationProvider.fixHashFragmentLinks(true);
});
```

In addition, you need to inject the `$anchorScroll` service to one of your controllers/services, to enable automatic anchor scrolling.

Closes #8675
Does this reproduce? A similar line already exists in [this test](https://github.com/angular/angular.js/blob/master/test/e2e/tests/sampleSpec.js), so I don't see a reason why it would break here...