i've had a closer look into the source of your JS Miner and I think there might be a multithreading problem or i misunderstood something. :-/
The way the get work protocol works is that is automatically gives you a new piece of work. There is no need for the server to care what the last thing it gave you was. You simply call getwork and the server will hand your client something different to work on.
The reason this isn't a race condition is because each work item contains many element that differ each time you request work. The timestamp updates every second, the merkle also changes with each request. Our site, currently, is dependent upon slush.... So, our merkle only gets updated every 30 seconds. However, we update our timestamp every second. Couple this with the fact that we tell the miner which nonce range to check, and that the range is completely random, means that the chances of two simultaneous getwork request getting the same work is insignificant.
I hope I made sense of that.