a lock and condvar according to the nspr documentation. r=valeski
Also I fix a problem where we would wake up from a wait without checking
any data which could cause all sorts of problems.
b=50634
git-svn-id: svn://10.0.0.236/trunk@77798 18797224-902f-48f8-a5cc-f745e15eee43