Elon Musk’s company confirmed the loss just minutes into the flight from the southern tip of Texas. The spacecraft’s engines shut down one by one, and contact soon was lost.