Truncate last_metadata file dumped by cfn-init hook

This patch truncates JSON-dumped metadata file (the default path
should be "/var/cache/heat-cfntools/last_metadata") by cfn-init hook,
and makes sure the file content includes proper metadata only.

Change-Id: I313cc63012134e10165f6bfe09b1096a3cb92cc1
Closes-Bug: #1391072
Fix docker hook README formatting

Change-Id: I364d9ea46e329b392f93736fc089f04c065519d9
Closes-Bug: #1380886
Merge "Fix docker hook README formatting"
Merge "Truncate last_metadata file dumped by cfn-init hook"