libvirt: Optimize test_connection and capabilities

The getCapabilities call can be very slow so it is not a good choice
for testing the libvirt connection. This patch switches to
getLibVersion and also caches the result of getCapabilities so it
doesn't need to be requested every time. Note that this means that
nova-compute will need to be restarted if the capaabilities of the
host changes. This is an acceptable risk because capabilities
changes should be very rare and nova-compute should be restarted
if libvirt is restarted or reinstalled.

This simple change lowers boot time in my devstack install from
22 seconds down to 8 seconds!

Fixes bug 1100446

Change-Id: I1b5072a906b19c6130957cf255e8d35b20990828
Merge "libvirt: Optimize test_connection and capabilities"