Lock connect() int printcore (harden against #153)