fix `cleanup` global leak

Hey guys,

I found that every time I pause a worker, it creates a cleanup function in global object. This pull request is just add the `var` declaration for the cleanup function.

Thanks