Fix for #2678 CApplication::onEndRequest() fires twice

Fix for #2678 CApplication::onEndRequest() fires twice.