MSSQL's substring() implementation is somehow silly/strict and unable to
perform implicit casts to integer both for the start and length parameters.
This hits Moodle badly because of another problems (MDL-23997) we decided
to cast to string all bound placeholders long ago.
So this commit just enforces the cast of the start and length parameters to
integer. And includes unit tests for using placeholders on all positions in
the sql_substr() method.