PROTON-394 and PROTON-404: fixed head of line blocking issue in proton-c and fixed delivery-id sequence for proton-j; both these issues where exposed by the same test

git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1513608 13f79535-47bb-0310-9956-ffa450edef68