gbm/dri: fix memory leaks in error path