Guard against possible errors in ScopeManager.

These errors don't seem likely in normal use, but we're seeing intermittent failure
on the test machine which could be related.
Merge pull request #5981 from adobe/dangoor/5968-stringliteral-test

Guard against possible errors in ScopeManager.