add cleanup for unittest and close output stream for PMML after writing