Fixed JS errors in IE11 workaround when destroying a chart in the same thread as creating it. Closes #2030.