This first part just prepares the grounds for part 2 and doesn't add any new
functionality. It mostly consists of small refactors:
- move the pthread.h include higher as it will be used in the headers;
- use errno.h in scudo_allocator.cpp instead of the sanitizer one, update the errno assignments accordingly (otherwise it creates conflicts on some platforms due to pthread.h including errno.h);
- introduce and use getCurrentTSD and setCurrentTSD for the shared TSD model code;