lsm_datatypes.cpp: improve code details
lsm_datatypes.cpp: improve code details

 -changed cleanup codes to free function. I think it's better to change
  cleanup steps in the futhure.
 -add judgement before lsmType process.

Signed-off-by: Ma Shimiao <4511f16e942ad3568742865d09c9060c1d8bebb9@cn.fujitsu.com>

HP-Scale-out-Storage/libstoragemgmt,HP-Scale-out-Storage/libstoragemgmt,jumitche/libstoragemgmt,jumitche/libstoragemgmt,joehandzik/libstoragemgmt,libstorage/libstoragemgmt,lazy404/libstoragemgmt,HP-Scale-out-Storage/libstoragemgmt,tasleson/libstoragemgmt,cathay4t/libstoragemgmt,libstorage/libstoragemgmt,jumitche/libstoragemgmt,libstorage/libstoragemgmt,joehandzik/libstoragemgmt,cathay4t/libstoragemgmt,tasleson/libstoragemgmt,jumitche/libstoragemgmt,tasleson/libstoragemgmt,jumitche/libstoragemgmt,cathay4t/libstoragemgmt,cathay4t/libstoragemgmt,joehandzik/libstoragemgmt,HP-Scale-out-Storage/libstoragemgmt,lazy404/libstoragemgmt,cathay4t/libstoragemgmt,tasleson/libstoragemgmt,lazy404/libstoragemgmt,libstorage/libstoragemgmt,tasleson/libstoragemgmt,lazy404/libstoragemgmt,joehandzik/libstoragemgmt,libstorage/libstoragemgmt