SolrTTMServer: corner case tweaks

Wrap whole query into try-catch, because if the request times
out, exception can be thrown when iterating the results, not
only when executing the query. Also impose a random max limit
on the query string length for now.

Bug: 43778
Change-Id: I10ad6aded1dcab68f453767c08ba1dd77e2302d9
Merge "SolrTTMServer: corner case tweaks"