Apologies, I thought you were the one suggesting he stays on for an extra month. I only skimmed the start but became interested when people started throwing around legal princples.
If OP changes the locks stays in the property, In court, this will be a circular (and rather pointless) argument:
1. The LL claiming the T is in some form of random breach and retaining the deposit.
2. T staying for the month because he doesn't have his deposit back.
The court will likely offset the two. However, if the LL could evidence someone's intention to rent the property at twice the price for the intervening period, the LL may have an argument to sue at a higher amount for the breach.
If the T leaves on the day, follows Jimbo's instructions and still doesn't receive his deposit, then he ought to sue for breach of contract. Clean and simple. I don't see why he then needs to muddy the water by retaining the keys and imposing (to my mind) some form of unlawful lien. It'll all end up in court anyway so might as well arrive there as clean as possible.
Equally, the T had a clear intent to sublet the flat so isn't entirely innocent, and some of the actions of the LL could be tempered in this light.
OP, my advice to you would be to document everything, give the LL a clear indication of when you would like to vacate the property. Do as Jimbo said and if the LL turns up without a cheque, start video recording it and exit peacefully. Prepare a claim to court/land tribunal (whatever the correct process is for tenancy disputes) and then simply sue the LL. I don't think you want to be getting into potentially physical altercations and have the worry that the LL willl bust down the doors etc.