linkcache: print exception text for failed module import

If a database module is missing dependencies, it won't be obvious which
dependencies are missing unless we print the exception text.

Signed-off-by: Jeff Mahoney <jeffm@jeffreymahoney.com>
tests: add unit test for rewriter

Signed-off-by: Jeff Mahoney <jeffm@jeffreymahoney.com>