sysdb: When using -c, wait for the server's final response.

There might be some intermediate log messages, which should be printed but
then we need to wait for further replies.
sysdb: When handling a reply, base further actions on the response code.

This will actually enable the command handler to see whether a log message or
a query response was received.

Also, this ensures that the command handler may correctly detect errors during
query execution and exit with a non-zero code accordingly. The simple_query
integration test was updated to reflect this new, corrected behavior. Thanks
to the test for actually catching this misbehavior! :-)
integration/simple_query: Added more types of simple queries.
integration/simple_query: More explicitly document expected exit codes.
integration tests: Use LD_PRELOAD instead of chrpath.

chrpath requires that the new path be shorter or the same length as the
previous path.