fdo#74252: Fix crash on exit with the customize dialog.

pEventLB gets accessed after it's been deleted. Moving the code that
accesses it to before it gets deleted fixes the crash.

Change-Id: If559fe3ea7dd76a3394d0aa7c18c9329188aa17f