Avoid directly calling objc runtime functions in C

By managing autorelease pools in objc code we avoid warnings on OS X
10.9 and it is also safer than calling objc runtime functions from C.
Avoid warning if HAVE_DUP is redefined
Snapshot 72