Wrong erase_node status during provisioning

Notifying about problem with reboot only if reboot was required
but node was not rebooted.
Refactoring, tests.

Change-Id: I02ad7d4b28829423726fd4e3887fbbe0d4478b81
Closes-Bug: #1264079