### Apache Airflow version

2.2.0 (latest released)

### Operating System

Red Hat Enterprise Linux Server 7.6 (Maipo)

### Versions of Apache Airflow Providers

_No response_

### Deployment

Virtualenv installation

### Deployment details

For this usecase - I am testing with a non-root user on a machine where the user does not have write access to /tmp. 
The `TMPDIR` environment variable is set to a different directory.

### What happened

When running webserver, errors like this are shown and slow down the webserver. 
```
[2021-10-25 13:46:51,164] {filesystemcache.py:224} ERROR - set key '\x1b[01m__wz_cache_count\x1b[22m' -> [Errno 1] Operation not permitted: '/tmp/tmpbw3h3p93.__wz_cache' -> '/tmp/2029240f6d1128be89ddc32729463129'
```

### What you expected to happen

Airflow should respect the `TMPDIR` environment variable and use a different temp dir

### How to reproduce

_No response_

### Anything else

_No response_

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

airflow/www/app.py
flask_app.json_encoder = AirflowJsonEncoder
    csrf.init_app(flask_app)
    init_wsgi_middleware(flask_app)
    db = SQLA()
    db.session = settings.Session
    db.init_app(flask_app)
    init_dagbag(flask_app)
    init_api_experimental_auth(flask_app)
    init_robots(flask_app)
    Cache(app=flask_app, config={'CACHE_TYPE': 'filesystem', 'CACHE_DIR': '/tmp'})
    init_flash_views(flask_app)
    configure_logging()
    configure_manifest_files(flask_app)
    with flask_app.app_context():
        init_appbuilder(flask_app)
        init_appbuilder_views(flask_app)
        init_appbuilder_links(flask_app)
        init_plugins(flask_app)
        init_connection_form()
        init_error_handlers(flask_app)
        init_api_connexion(flask_app)
        init_api_experimental(flask_app)
        sync_appbuilder_roles(flask_app)
        init_jinja_globals(flask_app)
        init_xframe_protection(flask_app)
        init_permanent_session(flask_app)
        init_airflow_session_interface(flask_app)
    return flask_app
def cached_app(config=None, testing=False):