assert: use `util.isError` for type check.

When testing if `actual` value is an error use
`util.isError` instead of `instanceof`.