Fix #808 by also clearing the supertype cache of transitively imported
modules