Move is_interrupt_request check at the end of trigger_data_flush
The check was introduced by 3fc63536 to fix a possible deadlock. This however caused the trigger to not properly handle current block_num, which was skipped because of early return. The block was not pushed to the database and this later lead to foreign key violation when updating `irreversible_data` table. To fix the issue, move the check at the end of the trigger function, after the current block is handled.