Resolves issues with wait_for_server_task_state

* Added null check before calling lower() on values
* Fixed guard condition for server going into error status check
* Added missing parameter name for for format function for
  server in error message

Change-Id: Iec6c1133d8315256e4256cbe56bdda7af655b61a
Merge "Resolves issues with wait_for_server_task_state"