hwc: fixes for vsync and race conditions

- Fix some race conditions between hwc_eventControl and the hwcVsyncThread.
- don't call vsync-ctrl ioctl for same enable value
- move enable disable ioctls to vsync thread, this stabilizes the vsync
  signal
- read again if vsync read is interrupted

Change-Id: I4065918b352769dd9fe18bd0dff4a87053299189
CRs-Fixed: 393243

Conflicts:

	libhwcomposer/hwc.cpp
hwc: dont return from vsync thread when read fails.

Read can return fail when the panel is off.
When read fails do not exit from the vsync thread,
continue with the vsync signal, as later there will
be correct vsync event from the driver

Change-Id: I0f145b93fe5d365eafb6b9e7661160f00f84db40
CRs-Fixed: 417529
hwc: avoid open/close of sysfs node on each vsync

Opens fb0 and fb1 vsync_event sysfs files at the beginning
and avoids open/close on each cycle

Change-Id: I68ffe6a615bb782879a16e5d3baa9afaf413558f

Conflicts:

	libhwcomposer/hwc_vsync.cpp