Add some PitchDetectionNode tests.

Also fixed a global leak, and a bad reference.