I added a test, to make sure this change didnt affect any current behaviour.
Just a short explanation, calling `clear_transaction_record_state` in here is safe because it will decrease the `@_start_transaction_state[:level]`, but it wont clean the record, as this is inside a transaction so the level is at least 2 before this clean-up.