PROTON-318: update the state field based on the outcome

git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1486643 13f79535-47bb-0310-9956-ffa450edef68
PROTON-320: use varags for the mechanisms parameter to simplify usage for clients

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