command: Add option to spawn a command with a pgid
Processes can be spawned with pgid [1], which can then be used to kill a process and all child processes that were spawned with that pid as a pgid.
This allows us to, in a later commit, tie all Git commands to the
main Gitaly process. When a Gitaly process exits, a sys admin, a script,
or Gitlab Omnibus can do a kill -9 -<old gitaly pid>
to kill any process
that has as its pgid.
Add an option to allow commands to be instantiated with a parent pid.
fixes: #4493 (closed)