Fix opening and closing

These changes fix closing and then reopening the toolbox on the same target multiple times, as well as gracefully handling the failure from opening the toolbox on a tab that has native devtools already open.