add cache stats
fix race condition on queue_pending

A crash can occur if the main thread calls run followed by cancel
when there are no other items in queue_pending. This is because
the work queue condition was signaed but the work to be performed
was removed before dequeue happened.