Minor python fixes
python: Raise OSError on xseg_join if appropriate

Raise the appropriate OSError when xseg_join fails. Use the errno provided by
libc.