Fixed race in engine.

An application runs own engine in new thread in 'start()' method and the engine changes its state to running in that new thread. All requests to the application, which are received after the application is started and before the engine state is changed, will fail. This commit fixes the bug. Now engine sets its state to running in constructor, right in app_t::start() method. So an application can process requests right after it is started.