Fixed crash when playing against AI

which was due to calling UI refresh from outside the UI thread.