When JPMorgan Chase & Co. arranged a series of trades to shift the risk of losses from $20 billion of its loans, some of those dangers wound up at a familiar place: rival banks.