Two-loop stability of singlet extensions of the SM with dark matter