improve modules.kmod.mod_list()

* avoid file.readlines()
* use `with` statement to ensure file gets closed
* rename `file` var to avoid unnecessary shadowing of built-in type