Fix potential trust issues by using SO_PEERCRED.

Change-Id: I510fcabe3c2a7765684a31d0553ce73fa1e1ed56