Cleanup surface client implementation and add proper return value checks

Signed-off-by: Simon Busch <morphis@gravedo.de>
More work on error case handling

Signed-off-by: Simon Busch <morphis@gravedo.de>
Store window id and make it accessible

Signed-off-by: Simon Busch <morphis@gravedo.de>