get hostname only once, when class loads

in production, we’re getting out of memory errors when making the
system call which attempts to fork a new process. This change gets the
hostname only once, as the class loads.