Gareth, looking through this code I can't directly spot anything that could explain described behavior, would it be possible to get a sample executable test for it?
I suspect something with session store (active session list) that you have there, I see some queuing there too so without a test I won't be able to help out with this as it's bit of custom code.