Lawsuit-laden JP Morgan blames $400m quarterly loss on $9.2bn legal bill