Amazon reported its first quarterly loss since 2015 on Thursday, its money-making juggernaut stalled by a slowdown in pandemic-induced online shopping and a huge write-down of its investment in an electric-vehicle startup.