Fix extent calculation of KisMask
Some time ago the masks started to support indirect painting,
therefore their extent-related methods should also combine the
corresponding methods of temporary target
BUG:394438
(cherry picked from commit 5255a2f3c959c7843e4837aa895f5ee385c27135)