uwrap: Introduce UWRAP_LOCK_ALL and UWRAP_UNLOCK_ALL macros

Introduce UWRAP_LOCK_ALL and UWRAP_UNLOCK_ALL which make
locking easier.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
uwrap: Prepare for overload of libpthread functions.

uwrap_bind_symbol are now renamed to uwrap_bind_symbol_libc
and simlilar uwrap_bind_symbol_libpthread are introduced.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
uwrap: New internal uwrap_copy_id function has been added.

Function allocates and adds struct uwrap_thread to linked list.

Primary reason for this function is to copy metadata from parent thread
to child thread.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
uwrap: Support scenario where threads creates threads.

uwrap catches calls of pthread_create() and pthread_exit() functions from libpthread library now.

Signed-off-by: Robin Hack <hack.robin@gmail.com>
tests: Add new test_thread_create_thread_setgid.

Test aims case where thread change uid/gid and then create new thread.

Signed-off-by: Robin Hack <hack.robin@gmail.com>