writer: correctly handle the no connection error
Merge pull request #96 from mreiferson/fix_pub_no_conn_96

Writer._finish_pub() throws an exception if the writer is not connected
flake8