yaffs-direct: Fix object leak caused by defered free
The change to dtest.c adds a test case that was leaking objects.
The change to yaffsfs.c fixes this.
This leak was triggered by sequences of the following form:
yaffs_open(file_name, ...); /* create obj */
...
yaffs_unlink(file_name);
yaffs_close(file_name);
When the file was closed, obj->my_inode was not NULL when yaffs_del_obj() is
called, therefore the object was not released properly.
The fix "unstitches" the object before the call to yaffs_del_obj(), so that
obj->my_inode is NULL and the object freeing is done correctly.
Signed-off-by: Charles Manning <cdhmanning@gmail.com>