HORNETQ-1276
By stopping the session first we can avoid the deadlock
HORNETQ-1279
Fix NPE. By initiating the availableCredits inside the constructor we can avoid the NPE happening.