Consolidate code to use UriUtils.validateUrl instead of repeating code
several places.
Properly updated destroyed column in template_store_ref and
volume_store_ref in deleting template or volume.
CLOUDSTACK-2584: fix create template from s3
fix build