MusicMetadata: make sure the various get*Id() functions return the actual ID

Under most circumstances getDirectoryId() will return -1 since by default we
don't fetch the proper ID until dumpToDatabase() is called. This was causing
dumping the AlbumArt to the database to fail because it requires a valid
directoryID.

This just makes sure getDirectoryId(), getArtistId(), getAlbumId and getGenreId
will fetch the proper ID if necessary rather than returning an invalid ID.