Make `error` optional on the `onFailure` closure to indicate cancelled state

Also use `onWillDismiss` in the iOS web view controller to indicate that the closure will be called analog to a "viewWillDisappear" message. There currently is no "onDidDismiss" closure.