Apple will release a new update to iOS 4 at some point that will resolve this. Please apply the following workaround until Apple releases an update.
Apple has published an Apple KB article (https://support.apple.com/kb/TS3398) with a link to a configuration file that can be downloaded to the iOS 4 devices via e-mail or with the Safari browser on the iPhone/iPad. This configuration file will raise the timeout value from 30 seconds to 4 minutes. The file is a basic XML file that can be edited using a text editor if needed. The default value is 4 minutes, but can be raised in circumstances where 4 minutes is not enough. Note: 4 minutes is enough for the vast majority of customers.