Set proper errno code on allocation failures and change realloc, pvalloc,
aligned_alloc, memalign and posix_memalign implementation to satisfy
their man-specified requirements.
Modify allocator API implementation to bring it closer to other
sanitizers allocators.
Please don't prefix functions, variables and types in tsan with tsan. It's all tsan already. It's just plain pointless to prefix everything in tsan with tsan, everything in asan with asan, etc, and does not add any information for reader about purpose of a function or a type.
Also, diff will be much smaller if you name this function user_alloc and rename the old one to, say, user_alloc_noerrno. It will be just few lines instead of churning the whole codebase.