Allow tab-completion only at the end of line and replace magic number

Currently tab-completion may take place at arbitrary cursor positions, but there is no way to figure out the cursor position from within the line completion code, effectively preventing sensible completion at that place. Hence I limited tab-completion to the end of line, to prevent user confusion.

I also replaced the magic 9 in that line with '\t'.

A similar patch was merged to msteveb's repository as msteveb/linenoise#2