Support legacy check callback with `error: Error`

Legacy callback system would not present an array of errors to the
callback unless returnAllErrors was set. Updated the typescript version to
support this, since removal resulted in breaking of ORM.