Avoid NPE if the write listener is called once immediately after being set, even if no data was written (= the app doesn't send any message during the init of the connection).
I don't think Tomcat does it yet (this doesn't need to be ported to Tomcat 7 since it is not a Servlet 3.1 impl).

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1556071 13f79535-47bb-0310-9956-ffa450edef68