Metasurface-stabilized optical microcavities