Add failure messages to gin and js mojom encoder

I hit two failures while trying to use network_service
today, both of which would have been much easier to
catch with these two validators.

This CL adds validation of encoding array pointers.
We already validate in a few other places in codec.js
and clearly need many more.

This CL also makes it more clear in gin when type
coercion fails what argument (0-indexed) failed
to convert and what js type was seen in the process.

I started down the path of logging the c++ destination
type as well, but found I couldn't with our current
RTTI-less build.

R=abarth@chromium.org, hansmuller@chromium.org
BUG=

Review URL: https://codereview.chromium.org/798163002