Fix lack of locking in libc which was causing memory corruption

In libc.h there was an optimization which disabled locking when there
is only one thread. It was using 'threads_minus_1' field from struct
__libc. In OSv this field was always 0, so there was no locking.

It was causing memory corruption when running apache benchmark against
tomcat in OSv on SMP. This patch makes them go away.

The fix is to always lock as in OSv we always have more than one
thread.

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
elf: Ignore PT_PAX_FLAGS

Fixed the following abort when build was running mkzfs.py.

Done!
eth0: ethernet address: 52:54:0:12:34:56
[I/20 dhcp]: Waiting for IP...
[I/26 dhcp]: Server acknowledged IP for interface eth0
[I/26 dhcp]: Configuring eth0: ip 192.168.122.15 subnet mask 255.255.255.0
gateway 192.168.122.1
Aborted

Signed-off-by: David Leifker <dlei...@gmail.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>