FreeBSD syscall: fixes for semctl
On FreeBSD, the libc semctl function takes a union semun argument
for commands that take 4 arguments. It then gets that argument
via va_args and takes a pointer to it. That's what gets passed
to the sysctl - a pointer to union semun.
Previously we were handling the 4th argument as if it were
directly a union semun. This seems to have worked OK for years,
possibly due to luck concerning the way that va_args works
and/or the fact that the union is basically a union of
pointers. Recently I've been working on arm64 and there it
most definitely does not work.