Some Improvements for cxx-generator.

* Using `jsval_to_xxx` instead of `JS_ValueToIntxx`.
We need to check the return value of `JSAPI` such as `JS_ValueToNumber`
in our own jsval_to_xxx function. It will raise an error in the terminal for debugging more easily.

* Reporting an error when the count of parameters is wrong.

* Setting the return value(`JSVAL_VOID`) for the functions that return void.
Perhaps it's not needed. But i think this could be more precise。

* Using `JSB_PRECONDITION2` macro to check return value.
This marco is the same as which defined in cocos2d-iphone jsb.

*I will send a Pull Request to cocos2d-x repo too. Please review and give me feedback. Thanks.*