Justin Trudeau resigns as Canadian prime minister