Fix a bug where callback method in ThrowIfTimeout is executed in wrong place.