libc: implement __tls_get_addr() for static binaries
(cherry picked from commit ca46b5698e8ac38ab45d781d592700be59e7de97)