Who is "you" here? There may be several processes waiting on that lock. Even if they have a reliable crash detection mechanism, they'll have to coordinate to decide who's in charge of repairing the state. What if that process dies during the repair?
I'm not saying it's impossible, but you're basically implementing a distributed, embedded version of the lock daemon. And as all distributed things, fault-tolerance is hard. It's easier in a dedicated process or in the kernel because they're centralized (and if the kernel panics all processes stop; that can be emulated in a daemon).