fix rematch option

this.battle isn't available anymore after closing said battle, so the challenging should go before the closing
Merge pull request #281 from asgdf/patch-3

fix rematch option