Allow max query retries to be configurable.