notify() and wait() example problem on alternating threads