tests: actually test quiescent period is obeyed

The previous version of the test was catching AssertionError, but
TestCase.fail() raises AssertionError so it would always pass.

We can also skip the log inspection in this case.

Change-Id: I644d0dba57db3723087a28f22df55c17c2158412
insert commands into the top of the queue instead of appending

System.command_queue is supposed to be in descending order (most recent
command at the top).

Normally the insertion position makes no difference because we will be
querying System.command_queue back in a separate transaction, which
means it will always end up ordered correctly. This change is only
significant for tests which enqueue commands, expecting them to end up
in the right position in the list.

Change-Id: I69ee2c34535fffd662ea40c00a83b7b785da09f1
obey quiescent period in consecutive power commands

We need to wait for the quiescent period after waiting for all
predecessor commands, otherwise the quiescent period delay will happen
concurrently.

Also record the last command timestamp only when the command has
finished, rather than before it is started, since it may take some time
to complete.

Bug: 1079816
Change-Id: Id4bbf79ae739a669b54ffde0101329f5174424e1
split 'reboot' commands into 'off' and 'on' on the server side

This way the quiescent period will correctly be applied to both the
'off' and 'on' commands. Currently there is no delay between 'off' and
'on' when rebooting.

Bug: 1079603
Change-Id: I907d6f7b6546124769d2b267482345685e779fee