Add --dry-run option to db_patcher.js

Moves reading of the patches to a separate step prior to
deciding whether to perform a dry run or do the real patching.
Tidy up at end since we do not have to reconnect