Small fix for pxe_boot with query cpus

Clean up code to make it looks more simple and fix module reload failed issue;

Thanks,
Xu