errno is not shared between threads. Also:
signal handlers that call functions that may set errno or modify the floating-point environment must save their original values, and restore them before returning.
There does not add more race conditions because signal handlers execute in one of regular threads. In single-threaded program signals are functions that can be called by OS at any point of execution, but they do not execute at same time with threads.