add solv_memdup and solv_memdup2 inline helper functions