patch sql encoding bug in Queue Plugin

The failureMessage is not escaped for the DB when trying to write the failure message in markJobFailed. 
please use `(int)$id`