expr: Fix close_idx() documentation

close_idx(), due to its recursive nature, cannot detect missing opening
brackets, since the string it is given may be a substring within a
valid expression. It does, however, help detect missing closing
brackets.

valid() is used to detect all expression string errors.
expr: Update valid() documentation, add test cases