The burger chain swung to a quarterly loss, but its adjusted earnings and revenue beat Wall Street's estimates.