Fixed bug with sql generation in available_tags method

For me last solution didn't work properly with redmine 2.3.3 (ruby 2.0). And adding joins to scopes works for me.