Does it mean that the work is dropped only if the hash of previous block changes (good idea), otherwise new getwork is just added to the queue? I'm not sure how bitcoin daemon would handle a proof-of-work for old midstate that have current prevblock (e.g. in case of only merkleroot changed due to new transactions). Would it be accepted?
Actually, bitcoind changes the merkle root on every getwork, since the extraNonce (which is inside the coinbase transaction) is incremented every time.
It caches the trees for every merkle root in RAM and, when a successful proof-of-work solution is found, finds the corresponding tree to attach to the block.