Fix Bug 431268 - DUP flag incorrectly set by paho client

This issue is cause by caching the encoded message header, and didn't set DUP flag when retransmission in case of reconnect.

Bug: 431268
Signed-off-by: bzhangxmt <zhbinbj@cn.ibm.com>