Fix bugs in master

Ping @msmith-techempower and @aschneider-techempower for a code review before these changes are merged. I updated your port closing function quite a bit and fixed bugs that were preventing master from running properly. If this looks good it's ready to merge, but given how close you are to R10 I want someone to eyeball it before it hits master
After sending SIGKILL, you need to (maybe recursively, maybe that's overkill) also try to forcibly kill any processes who have a PPID of `dead`. ~~From this line, you could do something like~~ you actually should create a function for killing a process by pid in this "try sigterm, then sigkill" style:

```python
def __killProcesses(self, pid):
  os.kill(int(pid), 15)
  # Sleep for 10 sec; kill can be finicky
  # Check that PID again
  ps = subprocess.Popen(['ps','p',pid], stdout=subprocess.PIPE)
  (out_9, err_9) = ps.communicate()
  if len(out_9.splitlines()) != 1: # One line for the header row
    err.write("  Process is still alive!\n")
    err.write("  Sending SIGKILL to this process: \n    %s\n" % out_9)
    os.kill(int(pid), 9)
    # Need to kill any children of this process
    children = subprocess.Popen(['ps','--ppid',pid,'-o','ppid'], stdout=subprocess.PIPE)
    (out_children, err_children) = children.communicate()
    for cline in out_children.splitlines():
      if isinstance( cline, int ):
        self.__killProcesses(int(cline))
```

Might require some playing around, but I think that's the gist of it.