UK apologises for 'pervasive racism' over imperial war dead