Fixed #17413 -- Added as_dict() to ErrorDict

Added a as_dict() function to ErrorDict() since it's really hard to serialize form.errors