Cache C interface

It's a common idiom in Lua to cache the C interface:
```
local ffi = require('ffi')
local C = ffi.C
```
Caching the C namespace allows faster access to C functions. The codebase of Snabbswitch uses this idiom but there are a few places which don't, even when the C namespace was previously cached.