Bug 839271: Use the inner window ID to cache workers so we get a new one if the outer window doesn't change.

This changes to cache against the inner window ID rather than the outer window object. The test checks an attribute in the document that changes during the test, if a new worker isn't created it sees the old value and the test fails.