queue: improve test coverage of the package

We had some untested error handling code.