function toDisposable(fn) {
    const self = trackDisposable({
        dispose: createSingleCallFunction(() => {
            markAsDisposed(self);
            fn();
        })
    });
    return self;
}
Turn a function that implements dispose into an {@link IDisposable}.

@param fn Clean up function, guaranteed to be called only **once**.