sendfile/2 fails by throwing a {badmatch, {error, enotfound}}

The internal implementation for sendfile fails with a badmatch in
prim_file:sendfile/10 if the socket is not connected. This should
be fixed upstream, but as a workaround we catch the error instead
of crashing.