Fix unhandled exception trying to authenticate against Travis

Without this patch JSON data posted to the events endpoint will cause an
unhandled exception when trying to check for travis authentication.
This exception is caused by the request data not containing the expected
structure of a Travis event.

The method that checks if a request is an authentic request from Travis
is expected to simply return false for requests that do not originate
from travis.  The method itself should probably be cleaned up to make
this more robust, but this patch is sufficient to avoid the 500 server
error.
Save events before authenticating them

Without this patch events that cause unhandled exceptions in the
authentication logic will not be saved into the Events table for later
inspection.  This makes it difficult to see what incoming events are
causing the exception in the first place.

This patch changes the behavior of the system to store events to the
database prior to authenticating them.  There is some security concern
with this, as an attacker could overflow the events table with garbage
data, but this events table is primarily used for troubleshooting and
not for providing actual service, so the risk is worth the value of
having the troubleshooting information available.
Merge branch 'fix_cla_hook'

* fix_cla_hook:
  Save events before authenticating them
  Fix unhandled exception trying to authenticate against Travis