When the term of office of such referee expires or is terminated, the referee shall deliver to the successor or to the judge all books and papers in the referee’s possession relating to the office. Upon failure to do so within five days after demand by the successor or the judge, the referee shall be guilty of a gross misdemeanor.