flask: update: Avoid deadlock.