New configfile entries (bb #566, #508, #567)
wip2 pid
Detect stale pids (bb #556), and don't connect to SX on startup (bb #509)

Move pidfile handling to our code, open and write-lock the pidfile,
and keep it open (as read locked) until process exit.
This way we can detect if a pidfile is stale or not.

Also don't connect to SX on startup as it may not be reachable/up yet.
add --config-file flag