Added default exit handler which is called in case main returns and sleeps the main thread forever.