Make block device listing function configurable

... and mock it out in jujud tests.

Also, make use of this to test NewWorker in
a platform-independent manner.