fix: close stdin and stdout only in repmgrd

closing stdin and stdout might cause problems when using system(), so we
avoid it.