use RawBufferDeleter and unique_ptr to manage buffer

Signed-off-by: Wayne Wolf <wayne.ron.wu at gmail>