ServletWriter - registering WriteListener only when needed (contributed by Oleksiy)

+ jdk8 javadoc workaround (ignoring errors)