Fix a case where using the same variable name in multiple queries could be mis-analyzed by erl_syntax_lib, leading to wrong lc generation