How Canada emerged as the safest port in a storm of global trade