Fixed #21555 -- Made ValidationError pickable.

Thanks trac username zanuxzan for the report and original patch.