Camera: fix gfx undefined buffer issue

clear the render target before drawing, fix the undefined buffer
mess up issue of preview layer

Change-Id: I093fc0bdaf292fed2bc7f1a6d2678a94f25c9d55
CRs-fixed: 503216 506709
Gallery2: Clear undefined buffer before first draw

Clear undefined buffer before first draw.

Crs-fixed: 526603 523916
Change-Id: I1cfdb621bdcf08dc8994adddb0111a1aaf941f56
Camera App: return after synchronized block

For some boundary condition when surface allocated is null, due to
return within synchronization block it is giving ANR. This change
will ensure that return take place outside synchronization block.
It will also ensure to notify an object if already in wait state
before invoking wait on it.

CRs-Fixed: 529666
Change-Id: I8532aa410840785923388a879701be9e98b0154f