Amazon's sales increase in Q2 offsets net loss