fix resource leak: forgot to call rows.Close()
Several issues:
1. fix resource leak in ListBranches, same, forgot to call rows.Close();
also, before calling rows.Close(), need to check err first
2. add error as return value for ListBranches and GetTableSchema.
3. add TODOs for Query and GetTableSchema.
4. add error handling code for Query and corresponding tests
fix Rewrite bug; add test for the bug