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.

(There’s more broken stuff in JRuby. Will fix soon.)