Port back some patches on futex, to fix problems with process-shared. Also Fix compilation with gcc 3.7 and OpenWebOS.

Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>