sys_get_temp_dir() workaround for Max OS X

replaced sys_get_temp_dir() by realpath(sys_get_temp_dir()) to avoid errors on Mac OS X.
taken from https://github.com/symfony/symfony/commit/43a818e830d8c17c3c8e85f125cd5568e5f4871e