JPMorgan’s upbeat trading in Q2 offsets its loan-loss provisions