Fix crash when unplug the mouse when pointer in the window.

We should call wl_pointer_destroy to remove listener of
pointer after we unplug the mouse.

We should not only call OnSetCapabilities after we create input
but also call OnSetCapabilities before we destroy them.

BUG=250