fix race condition in monitorWait
fix race condition in monitorWait

We don't want to check Thread::waiting until we have re-acquired the
monitor, since another thread might notify us between releasing
Thread::lock and acquiring the monitor.

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