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.
Repair small mistake in previous commit.
Fixed an if/elif which shouldn't change much except maybe a small optimisation.
Added two test-cases for REPL-related usage.
One test checks if running the completion multiple times works fine.
The other checks if using the original ArgumentParser.parse_args()
method still works after having used argcomplete to generate auto-
completion for the command.
Merge pull request #90 from wapiflapi/master

Makes monkey-patching less obtrusive.