With warmer weather arriving, Mayor Bill de Blasio warned New Yorkers to avoid crowding on city beaches, saying they could be shut down completely if necessary.