Method and apparatus for controlling cooling of battery pack