Add missing 'require "socket"'

Audited files using 'Socket.gethostname' but didn't require "socket"
using the following command:

    ack -L 'require "socket"' $(ack -l 'Socket.gethostname' lib)

Fixes LOGSTASH-1974