Fix a bug: substr function provided by the rule language generates segfault when index is out of range.

git-svn-id: svn://irodssvn.ucsd.edu/trunk@5374 ea137bd6-aa86-47b6-b90d-b101d9f19a90