MRP-509 obdclass: correct shutdown

add zombie barrier in 2 places:
1) echo_device_fini, it is possible the echo connect method is called
and echo is connected to some upper layer; as class_manual_cleanup()
is not called for echo, we are cleaning up from bottom to top, i.e.
zombee barrier in the bottom layer is not enough;

2) class_detach, it is possible that next setup starts before previous
cleanup finishes, we need to wait for all the self-exports to die;

also avoid use after free in class_handle_ioctl for obd_device found by index or name

Change-Id: I3cbf78c9000973190ab97b3d2a8ea5c2280c33b1
Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Reviewed-on: http://morpheus.xyus.xyratex.com:8443/gerrit/166
Tested-by: Jenkins
Reviewed-by: Artem Blagodarenko <Artem_Blagodarenko@xyratex.com>
Reviewed-by: Alexander Zarochentsev <alexander_zarochentsev@xyratex.com>
Tested-by: Alexander Lezhoev <Alexander_Lezhoev@xyratex.com>
Reviewed-by: Vitaly Fertman <Vitaly_Fertman@xyratex.com>