OMS-7836, OMS-7899: Allow setting Stdio.UDP buffer sizes.

Mostly copied from Stdio.File.
Do some basic sanity checking in decode_res
Fix parsing of __attribute__