Don't try to kill if pid is nil
Forward signals to running process group

If a command spawns child processes within the same process group, then
they also need to receive the signals.
fix indent