Fix an iOS 7 crash that occurs when you background the application and have finish_sync_in_background enabled.

iOS 7 kills the application if you attempt to endBackgroundTask on a task that's already ended.

Also, fix a compiler ambiguity where the argument was named application and there was an instance variable with the same name.
Merge branch 'rhodes-4-ios7-fix-crash-on-background' into 4.0.0_KG