Only pass :locals to render_to_string if they are specified

Related to [#254]

In Rails 4, render_to_string() eventually calls:

    options.fetch(:locals, {}).keys

In prior versions, :locals => nil would not cause an issue, but here
would return nil and try to call nil.keys