What are the differences between value types and reference types in Swift, and how do they impact memory management?