[CRT] Update file descriptor handling to match Wine (4/7). CORE-14504
Import Wine commits by Piotr Caban:
*
c7b0fb51543 msvcrt: Use fd critical section in _dup2.
*
b052afd4afa msvcrt: Use fd critical section in msvcrt_free_fd.
*
16285f5700f msvcrt: Use fd critical section in read.
*
9ce2a8a60c1 msvcrt: Use fd critical section in create_io_inherit_block.
*
f00b7f40584 msvcrt: Use fd critical section in _setmode.
*
ba757eaec74 msvcrt: Use fd critical section in _write.
*
eec7a565bec msvcrt: Don't lock __badioinfo.