Improve speed and scalability of __tls_get_addr()

As explained in issue #555, applications which use thread-local variables
are noticably slowed down by our slow implementation of __tls_get_addr().

The compiler calls this function in shared-library code which uses thread
local variables. Our implementation used a mutex, which is slow (relative
to an ordinary variable access), and non-scalable (two threads cannot
concurrently access their own thread-local variable!). In this patch we
switch to RCU, which is significantly faster and does not prevent
concurrent use.

This patch improves the tests/misc-tls.so benchmark from 27ns to 8ns.
__tls_get_addr() is still significantly slower than without it (2ns),
so there is still room for improvement - but it's a good start.

I also measured this patch to improve by 17% the performance of an actual
application which makes heavy use of a thread-local variable. The same
application also had abysmal performance when run on two threads
(2-thread performance was 10 times slower than one thread), and this
problem was improved as well.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Further improve __tls_get_addr() speed

After a previous sped up __tls_get_addr() (measured with tst/misc-tls.so)
from 27ns to 8ns, this patch further speeds it up to 4ns. Subtracting the
test iteration time for a non-tls variable (2ns), we are left with a 2ns
overhead for accessing a TLS variable, which is probably small enough to
tolerate.

In this patch, we reorganize the code called in __tls_get_addr() to make
sure the fast path is indeed as fast as possible. We notice that in the
fast path, we just use the module number and don't even need to find
the elf::object pointer - and the previous code organization, which always
found the elf::object, was wasting time doing this. Furthermore, we can
use more inline code (the previous code had 3 layers of out-of-line
functions calling each other). As mentioned above, these changes together
reduce the __tls_get_addr() overhead from 6ns to 2ns.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>