Fix query functions

1. Query parameter processing had an off-by-one bug
2. Required internals were not reset for a second query
3. YATL couldn't handle non-NUL-terminated strings for compare
4. Wrong printf parameters used on some debugging messages

Fixes libattachsql/libattachsql#2