Nullify socket on error