fixed ifdef on SO_PEERCRED, not defined on mac os x 7.x (among other). also added code to use getpeereid if defined and not LOCAL_PEERCRED is defined.