Initialize all cgis before server threads start

I split initialization of cgis and initialization of threads. When `clone` method fails, this code successfully stops.

fix #159