Return the exit code in ScriptExecutor

Solving issue #987

Now the exit code from the script in project.json need to be zero to ensure a successful build/pack/restore.
I've considered to use `out`. However the downside is that it makes the client code complicated. This function is invoked multiple times in one body, it will force the consuming code to declare a string no matter what.