Allow calling declare_func() after check_func()
FFmpeg and x264 need this. While we could of course rewrite all of those tests, I think it's also possible to make this work for us without too much effort.
Basically, the cleanest way to do this would be to not set func_ref and func_new directly in check_func, and instead set them internally inside checkasm; then provide a way to get them back, probably via a dedicated function to get the right function pointer.
(Or we could move them to static thread local storage)