dictionary: move the Cainteoir dictionary entry writer to a helper method