A shooting outside the US consulate in Toronto is being investigated by police as a “national security incident”.