Safer $.fn.selectEnd

When `this.length` is 0, `this.val().length` will become `undefined.length` and cause a TypeError.