A Barcelona judge has dropped charges against Lionel Messi relating to alleged tax fraud in charity matches.