Rx: Fix socket() handling so errors are properly detected