Window functions bug fix

Fix for https://trello.com/c/UAvZoWvX/845-trying-to-use-window-functions-throws-a-nullpointerexception:

"We don't support window functions (OVER PARTITION...), but if you try to use them, it throws a null pointer exception."


    CREATE TABLE "i1" ("id" integer, "group_id" integer, "amount" integer);
    INSERT INTO "i1" ("id", "group_id", "amount") VALUES (1, 1, 1) RETURNING *;
    INSERT INTO "i1" ("id", "group_id", "amount") VALUES (2, 1, 10) RETURNING *;
    INSERT INTO "i1" ("id", "group_id", "amount") VALUES (3, 1, 100) RETURNING *;
    INSERT INTO "i1" ("id", "group_id", "amount") VALUES (4, 2, 1000) RETURNING *;
    INSERT INTO "i1" ("id", "group_id", "amount") VALUES (5, 2, 10000) RETURNING *;
    INSERT INTO "i1" ("id", "group_id", "amount") VALUES (6, 2, 100000) RETURNING *;
    SELECT "id", sum("amount") OVER (PARTITION BY "group_id") AS "sum" FROM "i1" ORDER BY "id";

`ERROR: class java.lang.NullPointerException`