Closed-time-path approach to the optomechanical backreaction problem