Add file check for named pipe

Checking for named pipes works differently from sockets.