netrc: fixed thread safety problem by using getpwuid_r if available