Microcavities on atom chips for single-atom detection