syscall: fix FD passing on FreeBSD and NetBSD

Fixes issue 3348.

R=devon.odell, minux.ma, bradfitz, mdempsky
CC=golang-dev
https://codereview.appspot.com/7406050