Set key and keyCode for keyReleased

`keyReleased` was returning 0 in Firefox and duplicate keyCodes in Chrome. This fixes the problem by setting `key` and `keyCode` right before `keyReleased` is called, as per the source comments and Processing documentation.