Checks whether a file contains a string, and if not, appends it to the end of the file