Bug 959730 - Move cleanup logic out of __del__, r=dburns