Fix search lucene migration on oracle stable6

first commit only uses the double subselect for mysql, fixes https://github.com/owncloud/apps/issues/1536
second commit is pure precaution.

@karlitschek @DeepDiver1975 @PVince81 @bartv2 @bantu please review

PS ignore the misnamed branch. this is against OC6.
* [ ] forward port to master