clear the flash with esptool erase_flash. The new Espressif SDK used in arduino esp8266 core 2.4.1 has problems with old settings remembered on the flash. If it doesn't help, erase the flash again and use lwip 1.4 in Tools menu settings for next uploads.