Fix cache lock for image not consistent

Currently 2 external (file) locks with different name
are created to protect image concurrent access for libvirt driver.
This may lead to image corruption in rare case. This patch change
the lock file name from nova-_var_lib_nova_instances_base_xxxx
to nova-xxxx to make the lock name consistent

Change-Id: I3e60c3bcf456d2392409aa56ba05f4ad8fdc0444
Closes-Bug: #1265452
Refactoring metadata/base

- Extracted out methods from get_openstack_item for handling version, content and path
- Replaced the if else style route configuration with a route configuration dict
- This will help adding new apis easier and be maintainable

Change-Id: Ie1885c439f3d119032dd1c7c7af070142987ba7f
Partially implements: blueprint metadata-service-callbacks
Merge "Fix cache lock for image not consistent"
Merge "Refactoring metadata/base"