Move token file in a synchronized block

If multiple tasks are running simutaneously, only one of them
should move the token file and the token is shared by the tasks.

Signed-off-by: Yinan Li <liyinan926@gmail.com>