glapi: parameter checking, failure paths, ... for add_function_name