Allow `rebuild` even if the machine is switched off

There shouldn't be any reason why a halted machine couldn't be rebuilt. It is also possible via the web UI.

We only need to refresh the machine state after the rebuild.