Enhancement of stability in randomly switching potential with metastable state