Fixes #1251 jsonp timeout raises two errors

I think `script.onerror = null` should be moved to line 78, so that it is executed also when there is no error (to avoid memory leaks).