Fix issue #1245 - options which don't exist

Fixes extra database load of `get_options()` queries in the rare case that some, but not all our options would exist.

Check is done on every upgrade to ensure continuous integrity.