Dynamics of nanosecond-laser-induced melting of tin in vacuum, air, and water