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
Merge pull request #1167 from jordansissel/fix-missing-requires

Add missing 'require "socket"'