According to your example code it should be impossible to get a
db 1 - begin
display_tick()
display_tick()
db 1 - end
sequence.
I assume you verified that there is only 1 task running the code.
Did you also verify that there is no stack overflow or an configASSERT ?
There must a fatal problem making the code running wild.
Alternatively you could comment out flash_db_operation and put in e.g. a vTaskDelay to simulate the flash operation to narrow down where the application gets corrupted.