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
(cherry picked from commit ec3d7e4cb882eff42fa8f1e5f8f52723fb909b0e)

Conflicts:
	nova/virt/libvirt/driver.py

Change-Id: I3adbb48a2859a54ed93503f26de684acbd157841
Merge "libvirt: Optimize test_connection and capabilities" into stable/folsom