Hess Has Second-Quarter Loss as Bakken Helps Lift Oil Output