Escape apostrophes in code output

Systems with apostrophes in them, like "Ben's Macbook Pro", create invalid code based on the names that come back from `Dir.tmpdir`. A simple one-line fix that I'm not quite sure how to write a test for, but it works with the above machine name.