tizenid: change rand() to rand_r( to fix the thread unsafe issue