Northern Ireland protocol 'not unlawful', high court rules