Rescue any scheduler thread error, fixes #309