fix($location/$browser): prevent infinite digests on empty hash changes

I guess that this function should be inside `browser.js` but there were other helper function here.