Apple has released new iPhone and iPad security updates to patch a vulnerability allowing the recovery of deleted chats.