fix to make repeated flint_cleanup() calls safe when there are registered cleanup functions