Fix JSON Schema errors no longer being reported

Since attachCurrentRequestToError() didn't return the Error object,
validation errors would supply null as error parameter to fn() and thus
be ignored.

I've fixed this and wrote a regression test. Tagging this as v0.2.1.