Update cached module configuration when profile switched
Avoid crash if lockfile is empty