Using weakref in DispatcherWindow.acquire and LocalJobsWindow.acquire

Fixes #1064.