Section 13. The guardian of a mentally ill or mentally retarded person or spendthrift may be discharged by the probate court, upon the application of the ward or otherwise, when it appears that the guardianship is no longer necessary; except that in the case of a mentally retarded person seven days’ notice of the petition shall be given to the department of mental retardation in the case of a guardianship established pursuant to section six A. In the event of the death, resignation or removal of the guardian of a mentally ill or mentally retarded person, the court, on the application of the former ward and after notice to his heirs apparent or presumptive, including the husband or wife, if any, and to the said department, may certify that the said ward is discharged by operation of law and, if it so appears, that guardianship of said ward is no longer necessary.