This fix is for compatibility with lwip_select(). It moves the lock to
UART which is the only VFS driver which is implemented and is not
"thread-safe".
When using multiple sockets, some of them could be incorrectly removed
from the fd_sets before passing these fd_sets forward to the socket
select function.
Closes https://github.com/espressif/esp-idf/issues/1987