Add an helper CHECK_ERROR_CLEANUP macro