Auto-generate const and typedefs

Add misc/gen_defs.rb. This script generates defs.go, which contains consts
and typedefs, from C headers. Generated typedefs are exposed as function
arguments or return types, but they aren't to be used in bindings
implementation (because we need to cast from Go types to C.* types,
which is very annoying).