Even if watch->messages->length is 0 there may still be some data from a message that was only written partially at the previous attempt stored in watch->write_data, so check for that as well. We don't want to write data into the middle of another message, which could happen when there wasn't enough bandwidth. https://bugzilla.gnome.org/show_bug.cgi?id=669039