This seems too tightly coupled.  Here are two alternatives:

* Fire an event, e.g. "beforeExecuteCommand", that CodeHintManager can listen for.
* Explicitly ping PopUpManager to close all popups.  I like this more since it generalizes the fix to cover other things like context menus.  It also avoids exposing a generic pre-command hook, which would be a tempting point for various tricky extension hacks (we'd probably prefer to think through the use cases of those things first).