Bank of America bucked the industry’s dour trading trend—but a shame about those legal costs