[core][binding] Close the timer if the callback has throwed in error also.
[testing] Add testing of console.