[#1595] Fix IllegalStateException thrown by HttpObjectEncoder when an empty HttpContent was written