Database: Have buildStringCast() actually cast for MySQL, MSSQL
While these databases allow implicit casts (at least from int to
string), in MySQL at least the implicit cast can prevent appropriate
index usage (see T216183). So let's have buildStringCast() actually do
the cast.
This also changes the base implementation in Wikimedia\Rdmbs\Database to
explicitly cast. Any other subclasses should check whether this new
version works for them.
Bug: T216247
Change-Id: I98c67c857b35de3191d47ab28810d8eb21ddbbc8