set errno when getpw*_r, getgr*_r, and getspnam_r fail

these functions return an error code, and are not explicitly
documented to set errno, but they are nonstandard and the historical
implementations do set errno as well, and some applications expect
this behavior. do likewise for compatibility.

patch by Rudolph Pereira.
3 files changed