Remove this call from here and put it in the `cleanup()` function:

```
        function cleanup() {
            _setStatus(STATUS_INACTIVE, reason || "explicit_close");
            _closeLiveBrowser(deferred);
        }
```

Note that `cleanup()` no longer resolves promise -- it gets resolved in `_closeLiveBrowser()`.

Also note I haven't tested this much, so let me know what you think.