Directly call terminate function of tern-worker on quit.