Add strptime().
Simplify implementation of localtime_r.

Patches from vtorri.