script: utils: Fix backspace on empty input.
Before this patch, pressing backspace on an empty input lead to:
ERROR: In procedure substring:
Value out of range 0 to 0: -1