Allow SQLite versions >= 3.8.7

In the process, I rearranged the 'if/else' such that the logic is
easier to understand.

Now it is:

If we have found the system sqlite AND it is less than 3.8.0 OR
 greater than  3.8.7, then proceed to use the system version.

This PR shouldn't be merged unti the questions I raised in #4496
are resolved.