Fix allocation-error-handlings for scope_new().