Bistability of an optical response of a photonic crystal with a dense resonant medium as a defect