fix compile of qt without egl available

move the dpy to the place where it is used inside the egl ifdef guard
fixes compilation on old distros not having egl

Change-Id: I7eebe5305f3a584c0c5da2ea7b9099fdd994249d
Reviewed-by: David Faure <david.faure@kdab.com>