Implement invalidateSurface() to free up surface memory

Change-Id: I848a9f37f1b2e9616c3e5254a6329531e8eec825
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>