Fixed end detection of tests
Manage room invitations so that the application does not need to care of the origin of the invitation which is currently different when coming from initialSync or when coming from a live event (see SPEC-54).

In both case, the app will see a MXRoom which MXRoomState contains one MXRoomMember (the current user) with a membership value of invite and the inviter id in the originUserId field.