testpy.py: add check for error tests

If onig_search() doesn't return an error even if 'err' is specified,
it should be a failure.
sample/crnl.c: fix wrong condition

The next 'else if' block was dead code because of the wrong condition.
Coverity Scan found this.
Merge branch 'master' into coverity_scan