src/bugsnag: fix Opera Mobile test failures

The old approach was giving failures on Opera Mobile (and probably
some other minor browsers). The problem is that
`document.currentScript` is unsupported by Opera Mobile, so it was
always undefined (hence, `lastScript`, too).

We use `document.scripts` instead. It is supported by all browsers:
https://developer.mozilla.org/en-US/docs/Web/API/document.scripts