Catch JSON decoding errors in Apache download strategy

c.f. #17772.