The distance fluctuation criterion for melting: Comparison of square-well and Morse potential models for clusters and homopolymers