add missing backticks all over the place

I know backticks are ugly and actually bad practice. Nevertheless, we currently need to use them for portability reasons. Please check that you add them whenever writing SQL. There are exceptions in installation and migration code, but for now the general rule is to always quote identifiers. Unquoted backticks are HARD to debug.

@icewind1991 @MTGap @karlitschek @DeepDiver1975 

Originally part of https://github.com/owncloud/core/pull/3583