Chevron reported a second straight quarter of profits, but low oil and gas prices dragged the company to an annual loss.