Add beam unix tests and fixes

This adds some tests to unix_test.go showing things that don't work atm,
as well as fixes a bunch of things:
* set CLOEXEC
* don't double free fds
* make fd passing limiting a bit more robust

These are all pretty trivial, i'll continue to look for ways to fix the new test failures.