linux-user: fix segfault deadlock

When entering the guest we take a lock to ensure that nobody else messes
with our TB chaining while we're doing it. If we get a segfault inside that
code, we manage to work on, but will not unlock the lock.

This patch forces unlocking of that lock in the segv handler. I'm not sure
this is the right approach though. Maybe we should rather make sure we don't
segfault in the code? I would greatly appreciate someone more intelligible
than me to look at this :).

Example code to trigger this is at: http://csgraf.de/tmp/conftest.c

Reported-by: Fabio Erculiani <lxnay@sabayon.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
[arm] fix segfault of multithreaded Qt programs in thumb2 mode

Patch by Richard Braakman <richard.braakman@jollamobile.com>.

This fixes a segfault when using QMutex in a multithreaded program.
The problem only shows up for ARM with Thumb2 and CONFIG_USER_ONLY.

The accounting of instructions in an IT (if-then) block went
off by one when a STREX exception was generated. This caused
the instruction after the block to be mistakenly compiled as
part of the block, and in case of a conditional branch this
meant generating a branch to a label that is never defined.

Signed-off-by: Oleg Girko <oleg.girko@jolla.com>