Improve detection of imports in hacking check

The hacking check for detecting cross-virt driver imports
only looked for 'from foo.bar import wizz' and not for
'import foo.bar.wizz'. Add support for the latter too and
test it.

Change-Id: I79d804b49e4be9827c4a5c172ffb8712c15f4071
Closes-Bug: #1261842
Merge "Improve detection of imports in hacking check"