Adjust to ObjFW API and fix a disconnect bug.