Metal frame as local protection of superconducting films from thermomagnetic avalanches