Remove any duplicate target flags

In the case where duplicate flags are passed to mpartial, the partial macro will generate twice for that flag causing potential compilation errors.

This fix ensures duplicate flags are removed while maintaining the correct priority order.