Add relatively paranoid input sanitisation to BasicDbStorage.

In particular, you cannot use any SQL conditions for BasicDbStorage::find.
But I grepped through the code and this does not ever seem to be used.

Change-Id: Id2ee63d876d6641b0590b7b37c9ef7f24dd497e7
Merge "Add relatively paranoid input sanitisation to BasicDbStorage."