Minimize CouchDB post requests in save_records script