Thank you very much for sharing the find 
gc_collect_cycles() function is indeed very useful and I'll look deeper into it (didn't do that before because it required at least PHP 5.3 - the most recent commit of Couch, however, has bumped the min requirement to 5.3 so this comes into our ken now).
As for the changes not getting committed, could you please share exactly at what point you are trying the commit while aborting execution? I would have expected $DB->commit( 1 ), where '1' stands for 'force', to work.

gc_collect_cycles() function is indeed very useful and I'll look deeper into it (didn't do that before because it required at least PHP 5.3 - the most recent commit of Couch, however, has bumped the min requirement to 5.3 so this comes into our ken now).
As for the changes not getting committed, could you please share exactly at what point you are trying the commit while aborting execution? I would have expected $DB->commit( 1 ), where '1' stands for 'force', to work.