Ensure `PbsJobFactory` raises a `RuntimeError` if no connection to the server can be made.
Remove use of `functools.wrap` to stay compatible with Py 2.4
Avoid closures when possible, module-level functions are faster.