Fixed a bug in sql migration script 020

In sql migration script 020_add_metadata_tables.py, the sql statements
to insert metadata from the meter table to the newly created tables
have never been executed.

Change-Id: I211e024ed8be65a19f670ce72e3035c8f8797a54
connection is not close in migration script

close the connection in migration script 021.
also close connection earlier.

Closes-Bug: #1255173
Change-Id: I27dab9bb08a5f9038d6a5fc1267c5a749b703a61
Merge "Fixed a bug in sql migration script 020"
Merge "connection is not close in migration script"