It might be worth trying Wildfly 10 which uses ActiveMQ Artemis. To be clear, the HornetQ code-base was donated to Apache ActiveMQ almost 2 years ago now. All development has been (and will be) focused on Artemis. If this same thing happens in Artemis then I recommend coming up with an easy way to reproduce the issue and then one of the developers can take a closer look.
Here are a few more details.
The problem happens regardless if I send an UNSUBSCRIBE or not before exiting. I do not send a DISCONNECT message. I am pretty sure that the problem occurs when the socket is shutdown and disconnected.