song, directory: fixes, source code annotations.

1) Add source code annotations so clang could detect memory leak.

2) Fix a directory handle leak (thanks to clang).

3) Fix a struct song reference leak.