src/plugin.c: Move the error-checking code up.