Human rights campaigners have lost a Supreme Court appeal over the legality of Northern Ireland's abortion law.