red-stack: Fix off-by-one in error exit path of init function