Revert "[ALOY-1116] optimize sync adapter, per pull 518"

Reverts appcelerator/alloy#556

Need to back this one out. The immediately-invoked function is necessary to enable variables to be garbage collected.