From your question:
*This is completely contingent on the fact that you assume your landlord may create a made up excuse of damages to keep the deposit.
Landlord-tenant law is done at the State/City level. Look for your local resources regarding landlord-tenant law. They will dictate what procedures a landlord must use to document the use of a security deposit. There is generally a level of documentation required, a timeline to provide proof, and providing receipts for parts and labor. There may even be a requirement for a walk through on the final day. If there is a dispute the law may require mediation or small claims court.
That being said, don't expect the landlord to allow you to skip that last month's payment. That would leave them completely exposed if you did damage the place. I had a tenant who hid the damage by putting a picture over the hole in the wall. Unless I was willing to look behind very piece of furniture I would not have been able to tell if there was damage.