How a tired Air Canada pilot narrowly avoided a massive plane crash