Rename EVENT_KEYBOARD_RELEASED and resolve a possible memory leak bug