Microptimize castling in undo_move()