Simplify ClosableLazy and prevent deadlock

This is a backport of the recent ClosableLazyFixes to the 2.3.x branch.