Improved UDP compatibility, fix TCP/SSL read buffer handling, improve UDP/TCP/SSL error passing

Supersedes #595. Requires tessel/firmware#104.
Should this check if it was already `_closed`?