Fix app behavior while profiling
Fix app behavior while profiling

Previously, Flask's `g` object was not cleared properly
between requests when using the profiler, which produced
unrealistic results.

privacyidea/privacyidea,wheldom01/privacyidea,wheldom01/privacyidea,privacyidea/privacyidea,wheldom01/privacyidea,privacyidea/privacyidea,wheldom01/privacyidea,privacyidea/privacyidea,wheldom01/privacyidea,jh23453/privacyidea,privacyidea/privacyidea,jh23453/privacyidea,jh23453/privacyidea,privacyidea/privacyidea,jh23453/privacyidea,jh23453/privacyidea,wheldom01/privacyidea,jh23453/privacyidea