Fixed an issue with incorrect depth calculation.  In addition, fixed an
issue where delimiters were being appended to the serialized string even
if an item was rejected due to exceeding the maximum depth.  Delimiters
will now only be appended if internal serialization was successful, max
recursive depth was not reached, and if the current item is not the last
in the collection.