Fix function writeFile.
Add event for handled unsolicited message to MPIAPI class.