[socket] Reduce handle manipulations in native (#5378)