New code from lwip project

lwip repo:
d6fbe2a fixed bugs #41495 Possible threading issue in select() and #43278     event_callback() handle context switch when calling sys_sem_signal()