avserver: use freopen to redirect stdin/out/err to /dev/null