WhatsApp, Telegram patch flaws in instant messaging applications