Have tried running this in an update hook, as well as via /devel/php, in both cases it failed.
Essentially, the taxonomy_term_save() function creates a term (as the name suggests) in the specified vocabulary. The vocabulary is supposed to optionally take the vocabulary ID or the vocabulary machine name. However, it currently only appears to work with the ID.
<?php
// this successfully inserts the term, but into a non-existent vocabulary with VID 0.
$res = taxonomy_term_save((object)array('name'=> "Test Tag", 'vocabulary_machine_name'=> "tags"));
// this successfully inserts the term, into the Tags vocabulary as expected.
$res = taxonomy_term_save((object)array('name'=> "Test Tag", 'vid'=> "1"));
?>
The attached patch attempts to solve this. Note: regrettably I'm not a regular bug fixer/drupal core contributor, so this may be better solved in one of those presave invokes or something.