Ensure only strings are passed to mysql_real_escape_string()
Under some conditions (Semantic MediaWiki, Gadgets), an integer is
passed to DatabaseMysqli::mysqlRealEscapeString (). This integer is, in
turn, passed to mysqli::real_escape_string (), which needs a string.
Under HHVM 3.19.1 (at least) this type mismatch causes an exception.
A typecast should prevent it.
I repeated the patch in other DB drivers where I could find a function
that escaped strings for SQL.
Bug: T163646
Change-Id: I1b7820bc064dc79498cf9f17747f745990c526b7