fix playlist items not being deleted from db during dynamic mode

Might also have fixed a memory leak. Looks like we weren't closing files
when dynamic mode deleted songs from the queue.