Implementing a safe put/get for Quickcheck generators.