Escape newlines and " in metadata script.

Change-Id: If0c8667042fe9f630ac04f1ca5c7f390fdcbc94a
Reviewed-on: https://review.openstack.org/34058
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Approved: Jeremy Stanley <fungi@yuggoth.org>
Tested-by: Jenkins