smartplaylists: use simple WHERE conditions instead of expensive IN statements
smartplaylists: cosmetics in SQL queries
smartplaylists: use SELECT DISTINCT in SQL sub-queries
smartplaylists: replace SQL IN with SQL EXISTS in WHERE conditions
Speedup for opening music song library

Previously, this repeatedly parsed the same URL string over and over again
for every song, each time the list of songs was opened.

Benchmarks for CMusicDatabase::GetSongsByWhere() on a Raspberry Pi with a
library of 4115 songs:

Before patch: 14.5 seconds
After patch:   4.0 seconds
Merge pull request #3386 from Montellese/xsp_sql_optims

Optimisations for SQL queries generated for smartplaylists
Merge pull request #3391 from jmarshallnz/faster_getsongs

Speedup for opening music song library