Avoiding middle-income growth traps