The security firm in charge of the Olympics have been sacked with less than a week until the opening ceremony, with local police taking over.