Add localtime_r detection
Fix solaris build once more