strtok which is not MT-safe will be replaced by strtok_r

strtok is not MT-safe because it uses static variable to store last string.
it causes unexpected behavior when the scheduling is happened before
excuting strtok with 'NULL' argument. the static variable 'last' in the
strtok can not be guaranteed when the scheduled thread call the strtok,
also. instead, strtok_r should be used with the stack variable to store
last string.

Change-Id: Ia60835c2431d88098508b5c41f9e0edfa9710059