Improvements to global completion hook

- Fix handling of development mode script wrappers. Thanks to @jmlopez-rod and @dcosson. Fixes #69.
- Speed up code path for negative result by loading pkg_resources on demand.