Use only one temp canvas for patterns

This fixes a regression #3153 which was introduced by #2177.
The temp vanvases that are being created are not being re-used, which lead
to high memory use.
Fixing pattern canvas transform for chrome
Merge pull request #3179 from yurydelendik/pr-3171

Cont of #3171, Reusing pattern canvas fixes