When countries began locking down their economies early this year in the face of the spreading coronavirus pandemic, the world’s container lines braced for a steep decline in shipping demand. Analysts warned that massive financial losses would soon follow at seagoing companies that carry the lion’s...