Fix crashes occurring when the app leaves/enters foreground

Enables pause/resume when leaving/entering foreground.
Note: increases the deployment target to iOS 4.