Infrastructure to use a lift function when closing modules. Unactivated because the PathName.t type needs to be more precise