net: handle 'finish' event only after 'connect'

see #4997

/cc @bnoordhuis