The French government has been forced to modify a controversial "security" bill that would have curbed the right to film police officers in action after growing opposition and mass protests against it.