fixed crash on C++ code

correctly setup error code before return from
HandleTranslationUnit