Correct cleanup in mem test

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>
Fix cleanup issue in rwlock test

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>