Fix: Add callback when XHR fails due to connection error

Commit initially in gameclosure/native-ios
commit 247fa0a630bec44d9da7336800a6da07621e7482