Refund all unused units from tokens if token balance is zero

this way can prevent any units unable to be spent due to the bug of costing double tokens (like 10) but actually spent the right amount of units (50 units).

for example, the main menu shows 1000 units, but the graphic shows like 200, but you have no tokens in hand, it should trigger a refund.