Fix setTimeout bug with unmounted component

Was calling a function on the component after it got unmounted, causing
an error. Use `componentWillUnmount` to clear timeout.