French local authorities are to replace WhatsApp and Microsoft Teams with open source encrypted messaging software as part of a long-term move away from software produced by big US tech companies.