Quasi-smooth derived schemes and perfect obstruction theories