Use Java's queue implementation for more robust failure handling

The indefinite blocking of Ruby's queues makes me nervous, so here's a reimplementation using the Java queue + timeouts.

I think it would be best to hold off merging this until after the current release, since it doesn't address any particular issue and it would be good to have a sprint to put it through its paces.