core: Fix install modules for sites without database

Fixes #729