Minor changes to sell and buy.

When sell is called, waiting threads are notified now. In buy, threads
that are waiting may be woken up (from sell). If order still can't be
completed, they go back to sleep (for a smaller amount of time), until
that time runs out completely.