Stabilize linux.syscall_pwait test that currently (sporadically-) fails on Android.
Checks for pending signals in emulation of p* versions of system calls and aborts call if necessary.
Changes linux.syscall_pwait to using pthreads and cond_vars.
Adds subtest to check signal in "pending" state as well as signals arriving during system call execution.
Fixes #3336 (closed), #3344 (closed)