winxp threads: detect SRWLock emulation reentrancy
winxp threads: detect SRWLock emulation reentrancy

We lack SRWLock on Windows XP, so we use CRITICAL_SECTION to emulate it
there.  SRWLock is non-recursive, but CRITICAL_SECTION will happily
allow itself to be acquired multiple times by the same thread.

We need to detect if our second acquire succeeded because of the
recursive nature of CRITICAL_SECTION.  In the case of a _lock()
operation, we would normally have deadlocked, so abort.  In the case of
a _trylock() operation, we need to ensure that FALSE is properly
returned.

Problem caught by Matthias Clasen and Chun-wei Fan.

https://bugzilla.gnome.org/show_bug.cgi?id=660096

mzabaluev/glib,pstglia/platform-external-bluetooth-glib,gale320/glib,tchakabam/glib,iConsole/Console-OS_external_bluetooth_glib,iConsole/Console-OS_external_bluetooth_glib,johne53/MB3Glib,bluez-android/glib,tamaskenez/glib,mzabaluev/glib,pstglia/external-bluetooth-glib,justinkb/aosp-bluez.glib,darren-clark/android_platform_external_bluetooth_glib,MathieuDuponchelle/glib,gale320/glib,ieei/glib,gale320/glib,johne53/MB3Glib,iConsole/Console-OS_external_bluetooth_glib,01org/android-bluez-glib,endlessm/glib,justinkb/aosp-bluez.glib,cention-sany/glib,cosimoc/glib,krichter722/glib,Distrotech/glib,01org/android-bluez-glib,cention-sany/glib,pstglia/platform-external-bluetooth-glib,ieei/glib,pstglia/external-bluetooth-glib,darren-clark/android_platform_external_bluetooth_glib,djdeath/glib,antono/glib,endlessm/glib,Distrotech/glib,cosimoc/glib,antono/glib,lukasz-skalski/glib,justinkb/aosp-bluez.glib,pstglia/platform-external-bluetooth-glib,pstglia/external-bluetooth-glib,pstglia/external-bluetooth-glib,endlessm/glib,darren-clark/android_platform_external_bluetooth_glib,ieei/glib,Distrotech/glib,lukasz-skalski/glib,gale320/glib,justinkb/aosp-bluez.glib,tamaskenez/glib,pstglia/platform-external-bluetooth-glib,mzabaluev/glib,johne53/MB3Glib,cosimoc/glib,MathieuDuponchelle/glib,djdeath/glib,johne53/MB3Glib,bluez-android/glib,johne53/MB3Glib,bluez-android/glib,cosimoc/glib,cosimoc/glib,tamaskenez/glib,djdeath/glib,cention-sany/glib,tamaskenez/glib,gale320/glib,bluez-android/glib,justinkb/aosp-bluez.glib,Distrotech/glib,krichter722/glib,pstglia/platform-external-bluetooth-glib,krichter722/glib,01org/android-bluez-glib,lukasz-skalski/glib,krichter722/glib,Distrotech/glib,tamaskenez/glib,djdeath/glib,endlessm/glib,tchakabam/glib,mzabaluev/glib,iConsole/Console-OS_external_bluetooth_glib,mzabaluev/glib,djdeath/glib,bluez-android/glib,lukasz-skalski/glib,krichter722/glib,01org/android-bluez-glib,pstglia/external-bluetooth-glib,cention-sany/glib,iConsole/Console-OS_external_bluetooth_glib,ieei/glib,ieei/glib,cention-sany/glib,lukasz-skalski/glib,01org/android-bluez-glib,tchakabam/glib,endlessm/glib,MathieuDuponchelle/glib,darren-clark/android_platform_external_bluetooth_glib,MathieuDuponchelle/glib,tchakabam/glib,darren-clark/android_platform_external_bluetooth_glib,antono/glib,tchakabam/glib,antono/glib,johne53/MB3Glib,MathieuDuponchelle/glib