Die immediately on connection errors

Also don't use a potentially uninitialized value for pref_screen :-). It's not
uninitialized since cffi memsets things for us, but it still isn't a great
idea.