When to Go: Optimization of Host Switching in Parasites with Complex Life Cycles