Fix 'buffer_recv' to accept flags

Currently, `buffer_recv` uses hard-coded flags containing `MSG_DONTWAIT` and functions that accept flags and invoke `buffer_recv` do not actually pass flags to it. Fix this so that `buffer_recv` accepts flags.