Fixed pause/resume not working correctly when closing a playing tab.