[ticket/12711] Cast values to string such that they are quoted in SQL queries.

The value is stored in a text column and the key is stored in a varchar. Some
DBMSes do not like it when we insert integers into text columns. Cast both to
string to be on the safe side.

PHPBB3-12711
Merge remote-tracking branch 'bantu/ticket/12711' into develop-ascraeus

* bantu/ticket/12711:
  [ticket/12711] Cast values to string such that they are quoted in SQL queries.