Ensure upgrades work if no version is provided.

A previous fix to ensure database upgrades worked correctly broke if a
version was not provided.  This also caused a unit test to fail.  Fix this
by checking for None before converting the value into the proper type.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>