Refactoring rps runner unit tests

  Function worker_thread is moved out of worker_process cause difficult to
  test it when it's nested.

Change-Id: I36d4fa91cfc96769087011f56a848e5987bdba24