Reduce memory usage when masking messages.

Avoid to copy the whole message two times in memory. It saves memory
(not able to measure) and also saves CPU (approximately 3 to 5%).