Constraint on the mass and lifetime of heavy neutrinos from the supernova 1987A in the Large Magellanic Cloud