validate coordinates for single-pixel writes

in the long run, we need to check our painting directives since this is quite expensive

This fixes the recent segfault which turns out to happen in paintRoundedCorner(), rather than the blitbuffer rotation. We should probably check parameters in that function then, but it is a bit over my head at the moment, so we can use this rather general fix in the meantime.