client: add option to keep queries on connection close