Global replacement of debugtools.h by wine/debug.h.
Convert all msvcrt locks over to use _lock and _unlock. Explicitly make msvcrt compile with multithreaded option. Fix flag handling in _sopen. Add W->A call for new _swopen.