Catch mqtt socket write error after disconnect
Part of #155