Hotfix/sql bug with NOT in with one key

This is an implementation of @markstory's suggested fix for https://github.com/cakephp/cakephp/pull/1232