Close client after scheduler disconnect

inverted: 1c34e01