masks: fix some rendering issues for the path shape (mostly affecting border cases)