libptree: allocate memory for parsed integer values

SRM has the concept of optional integer values when making a request.
This is represented in S2 by allowing the script to omit certain
arguments when issuing an SRM request.

When libptree is generating the corresponding node, the parsed argument
is represented by a pointer to the underlying integer type, with NULL
representing an unspecified value.

The current code has a bug where a structure is used provide both
the underlying value and the pointer to this value (which may be NULL).
When a value is set, the pointer part of the structure points to the
integer value part of the structure and the structure is returned.

Unfortunately, C will make a copy of the structure, preserving the values.
While both the value part and pointer part of the structure are preserved,
the pointer part of the new structure (like the pointer part of the
original structure) points to the original structure's integer value; it
does not point to the integer part of the new structure.

As the original structure was allocated from the stack, after the function
returns, the memory pointed at becomes available for other uses, so
may have a different value.

The problem is fixed by explicitly allocating the required memory from
the heap.