PROV-778 Run JSON service output arrays through caSanitizeArray() before passing it to json_encode

Also added additional condition to caSanitizeArray() where if the
encoding detection of mb_detect_encoding() fails, we remove the data as
well. In my tests this has proven to be the most reliable method of
detecting weird binary content (like, for instance, any content in
ca_list_items.icon).

This may have side effects on the EXIF extraction in the media
processing plugins but I ran a couple of tests and the data still
looked fine. Have to keep an eye on that though.