operations: rewrite the CPU version of pixelize.c

- Clearer and faster in most cases
- Don't try to allocate too much memory
- Use different paths depending on the size of pixels
- Handle properly the edges by not reading outside the extent
- Fix the test so it does not look outside of the extent either