MDL-36002 dragdrop: focus fix and exception catching

This sets the focus correctly after a cancel or drop event.
It also catches exceptions from the lock/unlock functions.