Added killTree method to make sure the entire process tree is killed when refreshing the main thread.

This fixes the refresh behavior for linux