[CHEF-5132(2)] Fix ImmutableMash and ImmutableArray to_hash and to_a methods

Issue #1307 rebased.
https://tickets.opscode.com/browse/CHEF-5132