Added is_file_exists and implemented a test cases. Resolved many file no...

...t found errors that followed by calling fopen inside get_unique_filename (applicable only to tests).

It seemed as if get_unique_filename adds a filename to the buffer, but does not guarantee the existence of the file. fopen should solve it.