Fix use-after-free in wifi_cleanup()

Release reference to cmd only after possibly calling getType().


BUG: 25753768
Change-Id: Id2156ce51acec04e8364706cf7eafc7d4adae9eb
(cherry picked from commit d7f3cb9915d9ac514393d0ad7767662958054b8f https://googleplex-android-review.git.corp.google.com/#/c/815223)

 virtual int handleResponse(WifiEvent& reply) {
         ALOGD("Request complete!");
 /* Nothing to do on response! */
 return NL_SKIP;
 }

 virtual int handleResponse(WifiEvent& reply) {
         ALOGD("Request complete!");
 /* Nothing to do on response! */
 return NL_SKIP;
 }
