xsi_semaphore: use MemoryDeleter instead of multiple free()