Fix locking issues with the RBTools API cache database.
Fix locking issues with the RBTools API cache database.

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.

Reviewed at https://reviews.reviewboard.org/r/6716/

datjwu/rbtools,davidt/rbtools,haosdent/rbtools,datjwu/rbtools,davidt/rbtools,haosdent/rbtools,beol/rbtools,reviewboard/rbtools,datjwu/rbtools,halvorlu/rbtools,halvorlu/rbtools,haosdent/rbtools,reviewboard/rbtools,beol/rbtools,davidt/rbtools,beol/rbtools,halvorlu/rbtools,reviewboard/rbtools