fix memory leak of audiorecorder instance and exception when freeing player instance