A knife-wielding terrorist trying to enter the Louvre museum in Paris shouted "Allahu Akbar" before being shot dead by French security forces.