HardwareRender: reorder EGL calls for onTerminate override

In onTerminate function, perform EGL calls in optimal order:

* Clear current context
* Destroy surfaces
* Destroy context

This avoids the need to mark resources for later deletion, and
improves functionality on buggy EGL drivers.

Change-Id: I226ee531b591e85ac523dba5451f98f78849042f
bootanimation: reorder EGL calls

Reorder EGL calls to avoid marking resources for later deletion.

Before:
* Destroy surfaces
* Clear context

After:
* Clear context
* Destroy surfaces

Change-Id: I870d8e0956547555c283895e1e6e17a48f0a2500