Set device_id at the beginning of Solver.Init()

Following up to #507.  This change avoids using memory in default GPU by setting the device_id at the initialization of `Solver`