Add changes from Alistair Neil

- No need to record the dmtcp port by hand
- Handle gridengine SGE_STARTER_SHELL_START_MODE