Handle search commands only if the search panel is open.

Based on icsharpcode/ILSpy#394.