malloc new string for lowercased filename to avoid stomping on existing filename