Typesafe by Definition for Languages with Explicit Deallocation