Refactored the popen call for ycmd

Also removed shell = true in the other branch that calls popen