rtld: make dlerror() thread-local
(cherry picked from commit 4d9128da54f8f8e2a29190ffb18880c4f116a205)