Fix OutOfMemory bug by releasing writeAppender after importing template

The statement logger.removeAppender( logName ) will not remove writeAppender. The result is that the BI server will hold a lot of unused writeAppender, which will eventually lead to OutOfMemory situation after importing a large number of templates.