Copy the JID. This was causing crashes as the pointer was freed twice.