backport reboot tool to 1.21

As discussed with @fwereade, this is just a backport of:

https://github.com/juju/juju/pull/1086

to the 1.21 branch.
Bah, I thought we'd moved this onto the context? But if it matches what we currently have in trunk, don't worry.