trap accept() errors

report and bail
PG connections must not be shared among threads

synchronize with mutex