Update Aho-Corasick.cpp

correcting checking for errors.