[FIX] migration: test if package is installed using its state.

checking if there is an installed version set is not enough because this field is not reset when the module is uninstalled