x11: Clean up XEvent construction code for tests.

There were subtle differences between the event construction code
for various types. So put them all in one place to avoid confusion.
The main changes in this patch are in events_x_utils, where various
Init*EventForTest() functions get replaced by corresponding
ScopedXI2Event::Init*Event() methods. This makes it easier to manage
the lifetime of the created events.

BUG=none
R=jochen@chromium.org, sky@chromium.org

Previously committed in 237199, and reverted in 237246 because it
introduced an uninitialized memory read.

Review URL: https://codereview.chromium.org/82763010

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237275 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 237275