Scalar dark matter production from preheating and structure formation constraints