gluster: Update gluster hook content during sync

Insert content of hook when a new hook is detected
during the sync process.
Refactored code by extracting methods for save/update
hooks

Change-Id: Ie7c951f9c370b49557d7ca037185b098fa869fde
Signed-off-by: Sahina Bose <sabose@redhat.com>