[obj2yaml] Fix "time of check to time of use" bug. Add a test.