check winner of tic-tac-toe