Fix size_t handling in plugin_get_buffer()