Fix functional shell tests in travis

Hostname in travis contains random numbers meaning that it occasionally may 
contain a PID as well. Thus it must be replaced first.