Optimization on queue.delivery . Delivery packet being done outside of lock.

I've also added HangConsumerTest to guarantee that packets will arrive as the delivery is hanging.