check only active modules for last update

Detection of the last update should only check active modules. The tables for disabled modules may not even exist and thus lead to a fatal database error.