I've attached another iteration of the patch that fixes the multiple-window bug and adds (& uses) a function to create a Bitmapset using a custom allocator. I don't think there's any outstanding problems with it now.
> Alternatively, it might be trivial to make all aggregate functions work with ignore nulls in a window context
This is a good idea, but I'd like to keep the scope of this patch limited for the time being - I'll look at doing this (along with the first / last / nth value window functions) for a later release.