Ajax: Fix the invalid script test in Android 2.3

Android 2.3 doesn't support async script tags so if the injected script tag
refers to a throwing script, the error is thrown synchronously making the
window.onerror handler to not fire. Catch the error instead.