Enforce ref only for gerrit events that supply a ref

Invalid layout could be used and cause zuul to crash. If a ref
was specified for an event that did not supply a ref,
(e.g. patchset-created) then zuul would crash trying to match
the regex supplied in layout.yaml to event.ref, which would be
None. This results in all jobs failing, so this patch
makes sure that only the ref-updated gerrit event can have
a ref pattern specified.

Change-Id: I297e38f3749166ce54a946f6cbcf708744f20fa1
Merge "Enforce ref only for gerrit events that supply a ref"