fix(uiSref): Check that state is defined in isMatch()

Fixes #1314
Fixes #1332
Merge pull request #1361 from angular-ui/issue-1314

fix(uiSref): Check that state is defined in isMatch()