Fix 'r_magic_free' definiton (thanks @tautschnig)

> The function magic_close has return type void, but x is of a pointer type.
> Yet the C standard requires that the second and third argument of the
> conditional operator ?: are both void or compatible pointer types (there
> are several other cases, see 6.5.15 of the C Standard). Failing this, the
> compiler may produce arbitrary code.
> The best way to fix this is likely changing the definition to
>  { if(x) {magic_close(x);} }.