Fix locking issues with the RBTools API cache database.
Review Request #6716 — Created Dec. 31, 2014 and submitted
When an RBTools command executed another command via a Popen call, the subcommand would fail with a locking error on the API cache database. This turned out to be the result of RBTools only ever calling commit() when exiting the process. As per the sqlite documentation, any write operation will lock the database, blocking all reads, until the process calls commit(), but we weren't doing that after writes. We now call commit() after we close the cursor for any write operation.
Successfully ran 'rbt land' with a remote change, resulting in it
calling out to 'rbt patch'. It didn't lock the database.