When handling G2 search results, make sure the Gnutella hop count is correct.

Because most of the code is shared between G2 and Gnutella, we need to
make sure the "Gnutella header" in each node bears a proper hop count when
processing G2 search results, to be able to process packets from neighbours
correctly without triggering assertion failures.
thread_sig_handle(): assert that we're always called with an empty lock stack.
thread_lock_reacquire(): use te->sig_handling to cheaply disable signals.

We used to increment the lock count, but that was not a good idea since the
spinlock_loop() routine checks for self-deadlocks: if we incremented the lock
count artificially and the first (stale) entry in the lock stack happened to be
the lock we are attempting to re-acquire, it would (wrongly) report a deadlock.