Safety of coffee in thermal flask, long periods of time
Coffee in a container is approximately as safe as boiled water in a container. While it may be unpleasant tasting, the water in coffee and tea is almost universally boiled, and the scalding liquid is placed directly on the grounds/tea leaves. There is a little nutritional value in coffee and tea extracts, providing some support for new microbes introduced after the boiling, but not much.

There is no reason to be wary of coffee kept in a clean, sealed container for a day.