Fix remove pointer so it works for cv-qualified function pointers in VC-10 (compiler bug workaround). Fixes #5484.