fix of framework build bug and memory leaks

# framework build
headers in *project* moved to *public*

# memory leak
set CF_RETURNS_RETAINED to fix up Xcode/Analyze function
add CFRelease
add free 
avoid retain cycle