esp: ensure cmdfifo is not empty and current_dev is non-NULL