Write a JSON to file disk, also creates directories in the dest path if they don't already exist.