util: fixed a bug in str_to_time

str_to_time didn't work for negative timestamps on 32bit machines