Fix null pointer reference in length() function.

It's legal for datatype_out to be NULL.
Merge pull request #1141 from kacfengine/length_func_null_ptr_bug

Fix null pointer reference in length() function.
cf-upgrade

cf-upgrade is a specialized tool for automatically upgrading CFEngine.
The architecture is explained in the README.md file inside the cf-upgrade
folder.