mirclient: Release resources in the proper order

Release the InputContext after releasing the Surface that is
using the InputContext in its event callback. Otherwise we
get a crash when an input event comes to the Surface
after the InputContext is destroyed, but before the Surface
itself has been destroyed.
mirclient: Release Window resources in the proper order

Release the InputContext after releasing the Surface that is using
the InputContext in its event callback. Otherwise we get a crash
when an input event comes to the Surface after the InputContext is
destroyed, but before the Surface itself has been destroyed.
Fixes: https://bugs.launchpad.net/bugs/1236225.
  
Approved by PS Jenkins bot, Ricardo Mendoza.