avutil/opt: check for and handle errors in av_opt_set_dict2()