Jamie Dimon managed to turn a multibillion-dollar trading loss into a winning moment.