Makes monkey-patching less obtrusive.
This fixes multiple issues. It prevents infinite recursion when the
completion code is called multiple times, it ensures the parser
doesn't loose its base class when being monkey-patched, and it
doesn't prevent parse_args() from executing unsafe actions when
it is not called for autocompletion purposes.