Fix use of "SELECT .. INTO" with windowing params

Includes testcase. Closes #127