Refactor valid_entity_length function in riak_cs_wm_object