perf: use strtok_r + strtod / strtoull instead of scanf

mwprof spends most of its time in scanf. Parsing the string by hand reduced CPU
utilization by a third.

Change-Id: Id80cb6d211aabbb7e2dee124cf179876c61619d6