python: import statement not generated when using KSY imports in a certain way
When generating Python code with Kaitai 0.9 for the .wav some import statements that should be generated are not generated.

The wav.ksy file has an import:

```ksy
  imports:
    - /common/riff
```
The code that is generated does not import the riff module. When adding a dummy type like this and regenerating, then it is:

```ksy
  dummy:
    seq:
      - id: dummy_id
        type: riff
```

The difference in generated code:

```diff
]$ diff -u wav.py.orig wav.py
--- wav.py.orig	2021-04-22 20:23:00.731716225 +0200
+++ wav.py	2021-04-22 20:23:14.630908638 +0200
@@ -9,6 +9,7 @@
 if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
     raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__))
 
+import riff
 class Wav(KaitaiStruct):
     """The WAVE file format is a subset of Microsoft's RIFF specification for the
     storage of multimedia files. A RIFF file starts out with a file header
@@ -456,6 +457,17 @@
             self.samples = self._io.read_u4le()
 
 
+    class Dummy(KaitaiStruct):
+        def __init__(self, _io, _parent=None, _root=None):
+            self._io = _io
+            self._parent = _parent
+            self._root = _root if _root else self
+            self._read()
+
+        def _read(self):
+            self.dummy_id = riff.Riff(self._io)
+
+
     class ChannelMaskAndSubformatType(KaitaiStruct):
         def __init__(self, _io, _parent=None, _root=None):
             self._io = _io
```

Another issue is that the class `Riff`, which is used in the code, is not imported either.

```python
$ grep Riff wav.py.orig 
        self.chunk = Riff.Chunk(self._io, self, self._root)
            self.chunk = Riff.Chunk(self._io, self, self._root)
            self.parent_chunk_data = Riff.ParentChunkData(self._io, self, self._root)
            self.chunk = Riff.Chunk(self._io, self, self._root)
            self._m_parent_chunk_data = Riff.ParentChunkData(io, self, self._root)
```

Normally I would have expected something like `from riff import Riff` for it to work.

My guess is that referencing an enum in an imported file is where code generation fails:

```ksy
seq:
  - id: chunk
    type: 'riff::chunk'
```

I don't know where in the compiler to fix this.