tests: Fix getsockopt() on Solaris.
test: Fix getsockopt on Solaris.
echo_srv: Add fd duplication and test it works.