Cast empty server-side events to object

A server-side event with no properties is represented in PHP as an empty array.
Because PHP does not distinguish between an empty indexed array and an empty
associative array, it serializes the empty array to '[]' rather than '{}'.
This is not the desired behavior: an empty event object should still be an
object. So cast empty events to object, ensuring they serialize correctly.

Bug: 65385
Change-Id: If4665ce2f97bacdd019829dbfa4e8ea239451854