Enhance personality switching

On syscall entry, save current personality in the tcb structure
along with scno.
On syscall exit, restore current personality from the tcb structure.
* defs.h (struct tcb) [SUPPORTED_PERSONALITIES > 1]: Add currpers
field.
* strace.c (alloc_tcb) [SUPPORTED_PERSONALITIES > 1]: Initialize
tcp->currpers.
* syscall.c (update_personality) [SUPPORTED_PERSONALITIES > 1]: New
function.
(get_scno, trace_syscall_exiting): Use it.

Reported-by: Michael A Fetterman <mafetter@nvidia.com>
diff --git a/strace.c b/strace.c
index 8f8c74c..2e96305 100644
--- a/strace.c
+++ b/strace.c
@@ -1276,6 +1276,9 @@
 			tcp->pid = pid;
 			tcp->flags = TCB_INUSE;
 			tcp->outf = outf; /* Initialise to current out file */
+#if SUPPORTED_PERSONALITIES > 1
+			tcp->currpers = current_personality;
+#endif
 #ifdef USE_PROCFS
 			tcp->pfd = -1;
 #endif