Fixed a bug related to inconsistent keyboard state

If the user starts playing around with search dialog (focusing, unfocusing,
editing text) while editing a marker information, weird things happen. Fixed by
forcing the close of keyboard and resetting root's state before showing the
search dialog.