hwcomposer : Synchronize EventThread, and hwcVsyncThread

Synchronization is needed,to make sure, read() is not called
by hwcVsyncThread when VSYNC is disabled.

Otherwise in usecases, where display is OFF, and still some
tasks keep running in the background; SurfaceFlinger keeps
using CPU.

Change-Id: Ic59d0c477bc8483dd731777ebde3cc9e12bb681a
CRs-Fixed: 393243
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
CRs-Fixed: 416487
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
Fix compile errors when using NO_HW_VSYNC

Change-Id: Id5436afc69e97abf8b48cc938f44ebd0f87b514b