Memory leak fix in del()

If del() is performed on last node, then it will drop the chain of nodes, this because of del didn't point last to the new node that becomes last.

This commit has not been tested yet.