Fix resource leak: AudioDevice is not closed automatically if it's not closed explicitly.