Added mutex for negotiation as well as added additional initialization and confirmation messages for the key negotiation. This was to solve some race conditions which were breaking things.