Method and device for controlling a solenoid actuator