Add ps_buffer_drain() function

Signed-off-by: Olivier Langlois <olivier@trillion01.com>