fix race condition when closing a tab while playing