Fixed a bug where KeyBindings objects would leak memory on native platforms

Event listeners with weak references are not supported on native
platforms.