Get safe file name from a given string