nix_expr: Handle incomplete input more gracefully.

Getting an IndexError exception isn't very nice if the parser wants more
input. So let's handle that by a function _is_char(), that also checks
for the end of the input.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>