Remove invalid characters from app id to prevent loading of invalid ressources.

Backport of #1569
Merge pull request #1641 from owncloud/backport-1569

Remove invalid characters from app id to prevent loading of invalid ress...