fix IN subquery error for mysql

I got the same error issued at https://github.com/mbleigh/acts-as-taggable-on/pull/457. I created the rebased version of the patch instead of him. 

Could you merge this?