improve check for socklen_t

Change-Id: Ib16430975e82b8c21731b22f4ddd058d58886827