Implement the intermediate surface workaround properly (#220).

- No more surface allocation at each redraw.
- Ability to enable or disable the workaround at compilation time.