Unified handling of ngx_create_temp_file() return value.

The original check for NGX_AGAIN was surplus, since the function returns
only NGX_OK or NGX_ERROR.  Now it looks similar to other places.

No functional changes.
Core: added prefix-based temporary files.

Now, if the "path" parameter is NULL, ngx_create_temp_file() will use
file->name as a predefined file path prefix.
Cache: update variant while setting header.

Some parts of code related to handling variants of a resource moved into
a separate function that is called earlier.  This allows to use cache file
name as a prefix for temporary file in the following patch.
Upstream: use_temp_path parameter of proxy_cache_path and friends.

When set to "off", temporary files for cacheable responses will be stored
inside cache directory.