Amazon reports loss for quarter; 1st in 4 years