Add workaround for Nokogiri modifying input on JRuby

Nokogiri on JRuby modifies the encoding of the incoming content, which results in a “cannot modify frozen variable” error when used together with nanoc.

This PR moves the parsing in a separate `#parse` method, which catches frozen errors and retries with a duplicate of the input.

**Please note:** There are a bunch of failing/erroring tests on JRuby at the moment. Fixing these is not the purpose of this PR, but I will get to those tests soon.