Fixes #5866: ncf API hooks don't always fail on errors

http://www.rudder-project.org/redmine/issues/5866
Please also add the same mechanism as in post.write_technique.rudderify.sh to this script. I know there is only one step for now, but 1) it's always better to have a clear error message, and 2) more steps may be added in the future, and having the mechanism in place means the futur author will most likely use it.