Fixup BDD weakref garbage collection

The _RESTRICT_CACHE was creating some kind of circular reference, which
prevented BDD nodes from getting automatically garbage collected.
This change makes the restrict cache local to the _urestrict call.