Make "done" checker immune against setTimeout overrides