Fix reboot error detection

Since the reboot errors are printed to stderr, we pipe them into stdout
so that we get them using backticks. This might not be the most elegant
solution, but it works for now.
More robust reboot error detection