simplify multi-threaded errno, eliminate useless function pointer