fix pthread mutex and condition leak
fix pthread mutex and condition leak

Hi,

I did some more tests with my x86 QNX Avian port and found one major problem
in Avian VM while trying to run Apache Ivy. The problem manifests as
follows:

1. MySystem::Thread X is created, during its creation pthread mutex and
conditional variable are initialized
2. Program runs for some time
3. MySystem Thread X is disposed, it's memory is freed (during garbage
collection I guess)
4. Program runs for some time
5. MySystem::Thread Y is created in exactly the same memory address as
MySystem::Thread X disposed in step 3 (I suppose that's due to the way
memory allocator works in Avian)
6. During MySystem::Thread Y creation pthread mutex and conditional variable
initialization fail silently with EBUSY. QNX documentation says it means
"The given mutex was previously initialized and hasn't been destroyed."
which is correct, because it's exactly in the same memory address as mutex
and conditional variable of MySystem::Thread X and they haven't been
destroyed during MySystem::Thread X disposal

Fortunately solution for this is easy, see the attached patch. Now Apache
Ivy works without any problems.

Regards,
Stanisław Szymczyk

marcinolawski/avian,lwahlmeier/avian,minor-jason/avian,getlantern/avian,MaartenR/avian,minor-jason/avian,dicej/avian,bgould/avian,getlantern/avian,joshuawarner32/avian,lwahlmeier/avian,ucdseniordesign/avian,getlantern/avian,joshuawarner32/avian,joshuawarner32/avian,MaartenR/avian,bigfatbrowncat/avian-pack.avian,bgould/avian,lostdj/avian,minor-jason/avian,MaartenR/avian,marcinolawski/avian,lostdj/avian,lostdj/avian,bigfatbrowncat/avian-pack.avian,ucdseniordesign/avian,bgould/avian,dicej/avian,ucdseniordesign/avian,joshuawarner32/avian,MaartenR/avian,marcinolawski/avian,dicej/avian,bigfatbrowncat/avian-pack.avian,lwahlmeier/avian,dicej/avian,bigfatbrowncat/avian-pack.avian,lwahlmeier/avian,getlantern/avian,ucdseniordesign/avian,bgould/avian,minor-jason/avian,marcinolawski/avian,lostdj/avian