uritemplate: return `error`s instead of merely logging

Signed-off-by: Alejandro Mery <amery@geeks.cl>
uritemplate: improve lexer.fail() to include the position

Signed-off-by: Alejandro Mery <amery@geeks.cl>