Add testForMemcachedServer function

This just creates a TCP socket and trys to connect to the specified
port. if it fails we send a message to the node.js console.

This closes #1566