Add capability check for gerrit stream connection

Since Gerrit 2.7, capability for Gerrit stream has been added.
If user with no capability runs "gerrit stream-events", it returns immediately with no data.
Unfortunately, there is no way to know capability before actual Gerrit stream connection is established.
(REST API has such capability but I know it can be disabled when Gerrit is under reverse proxy.)

So capability for gerrit stream connection can be tested as follows:

* NG: End of stream has been reached without any data
* OK: data is arrived
* OK: End of stream is not reached until timeout

This patch adds capability test to doTestConnection() according to the
above policy.