libs/ip: return a copy of given tables in __mask16() to avoid destroying them later