af_ladspa: code cleanup

Cleanup based on results from cppcheck-1.59
Reduce the scope of several variables
Fix memory leak