Fix the order of fired events for registration failure

- Fire first the 'registrationFailed' event
- If the UA is registered, fire the 'unregistered' event