validations: support non-V8 browsers

Call `Error.captureStackTrace()` only when it is available.

Use `this.stack = (new Error).stack` when `captureStackTrace` is not
available but the `stack` property is (Firefox).

/to @ritch please review.