Change errno checking implementation in the foreign backend.

Whether to check errno is now recorded in the callspec, and
implemented as a branch in ctypes_call.
Support for releasing the runtime lock during calls to C.
Tests for bindings that release the runtime lock.