Frees a stock item allocated on the heap, such as one returned by copy.
Also frees the fields inside the stock item, if they are not null.
a StockItem