Render the selection mask only when necessary

This improves selection performance dramatically, especially when
feathering is enabled.

Unfortunately, feathering with large radii is still painfully slow.
Will investigate further.