New code from lwip project

lwip repo:
2666d6d fixed bug #41729 Some socket functions return Exyz instead of -1