task_state must be consider before many action

* Creating server status wait function for using with
  xml and json status wait.
* Considering fast status changes for BUILD status related tests.
  BUILD status wait can be useful when the server does
  not really need to be active for the test and we do not want to
  fail because the server reached the ACTIVE state before responding
  to the status query, due to rate limitation or for other reasons.
* Moving the wait function to new module, which could be used for
  collecting all wait related functionality.

  Fixing bug 1170118

Change-Id: Ie301124952412dab2b11a92a25ee54c633d08eeb
5 files changed