Fix two issues of user key map for extension commands.

This fixes #9954 and #9953.
The comment should mention why this function is "debounced".