replace strerror() with %m formatting (thread-safe)