do_variable_substitution(): First make a mutable copy for NSDicts

- fixes #24