Cleanup if it goes wrong

Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>