[telegram-desktop] Backported upstream patches with different fixes.