Several fixes for wait_for_pxe

This includes:
 - code cleanup
 - use the right IP address to compute the pxe file: this is the address
   of the node on the admin network, not MYIP
 - fix grep command when waiting for a specific state
 - do not use curl --head when fetching the content of the file