invoke callback with an error if the connection is closed when publishing a message