lw-ip:fix bug for crash when socket lock not initialized Closes WIFI-1713 See merge request espressif/esp-idf!7597