Preventing Water Heater Leak?
First of all even a tankless WH can leak, so in a vulnerable spot like an attic, you should have a drain pan under it to catch any leaks and route the water to a drain.  Same with a standard tank WH.  In fact, many AHJs require such for tank WHs at least.
If that's not present, you should shut off the water to the tank and drain it.  That will ensure that it won't leak until you get it replaced.
The house is not your responsibility until you close, so for now it's the current owners problem.  You could request a walk-through a few hours before the closing, and such things are not uncommon.  You should also be sure you get possession immediately upon closing so that you can go right to the properly afterwards and make sure it's all secure.