socket: fix out-of-bounds array write on Mac.

Signed-off-by: Peter Soetens <peter@thesourceworks.com>