Adjustments to cipher_migrate

- And format flags when checking for exit condition
- Pass key size to sqlcipher_check_connection
- Trace version upgrade logic