Instead of "pulseIn()", why don't you try to do a loop with a counter that counts how long the Galileo's input is high?
Also, I believe the HC-SR04 needs a delay of at least of 60ms to work properly.
I found the HC-SR04 in the Galileo/Edison Shield Test Report. According to it, the HC-SR04 is compatible with Galileo Gen2 and Edison but not with Galileo Gen1. The document has an example, I'd suggest you to take a look at it.