devserver: fix a bug when counting processes

The original code has a bug when run by Python 2.7.6 that it always
return 1 even there's no this process, see

Python 2.7.6 (default, Oct 26 2016, 20:30:19)
  [GCC 4.8.4] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import subprocess
  >>> p = subprocess.Popen('pgrep -fc "xxxx"', stdout=subprocess.PIPE,
      stderr=subprocess.PIPE, shell=True)
  >>> p.communicate()
  ('1\n', '')
  >>> p.wait()
  0
  >>> p = subprocess.Popen(['pgrep', '-fc',  "xxxx"],
      stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  >>> p.communicate()
  ('0\n', '')
  >>> p.wait()
  1

I don't have this issue when run above code with Python 2.7.16. I guess
it should be related to how subprocess runs a process in a shell.

BUG=chromium:961318
TEST=Ran local test

Change-Id: Ia2e06a58bea9c7a1581dab87441eb2d12cd59c1a
Reviewed-on: https://chromium-review.googlesource.com/1607084
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Congbin Guo <guocb@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
1 file changed