Updated window function analysis to fail queries without an over clause

This PR fixes #1786, and updates the window function analysis to fail queries that has a window function without an over clause with a descriptive error message.