Fixes replacement of table prefixes

If a package, that is no application, requires an application (in WCF 1, this would have been a plugin), only the `wcf1_` prefix is replaced, thus altering existing application tables or creating new application tables isn't possible.

This commit now replaces `app1_` with `app{WCF_N}_` for all installed applications.