gerrit-sync-ve: register Gerrit hook before commit

Gerrit requires a Change-Id in the commit message, so move the hooks
installation snippet up before the git commit operation.

Change-Id: Ia335a321e9221d2de9b65e1bd362f6d78e470312