Use stream/dgram autodection on /dev/log for syslog-ng compat

Patch from
https://raw.github.com/gentoo-haskell/gentoo-haskell/master/dev-haskell/hslogger/files/hslogger-1.2.1-dev-log-rdetect.patch

Patch comments:

"Detect "/dev/log" socket type (Stream / Dgram) at runtime
as it does openlog from glibc.

Patch based on report by George Diamantopoulos:

https://groups.google.com/forum/#!topic/ganeti/xnj-WctN7HY/discussion

Original bug report

https://github.com/jgoerzen/hslogger/issues/1

Reported-by: George Diamantopoulos
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>"

Fixes #1
Bring ability to use custom formatter with syslog

Closes #20

Conflicts:
	.gitignore
Fix compile errors on network <= 2.3
Bump version

Conflicts:
	hslogger.cabal
Relax network upper bound
Merge branch 'upstream'

Conflicts:
	hslogger.cabal
From errge:

Hi,

Test code:

import Control.Concurrent
import Control.Monad
import System.Log.Logger

main = do
  updateGlobalLogger rootLoggerName (setLevel DEBUG)
  mainThread <- myThreadId
  _ <- forkIO $ forever $ do
    killThread mainThread
    threadDelay 1
  forever $ logM "" INFO "foobar"

Running this after compilation like this, shows that killing a thread that is in a logging function right now is not stable:

ghc --make test && ./test 2>&1 | uniq -c

   1 Error writing log message: thread killed (original message: foobar)
1116 foobar
   1 fooError writing log message: thread killed (original message: foobar)
2569 foobar
   1 Error writing log message: thread killed (original message: foobar)
1717 foobar
   1 fError writing log message: thread killed (original message: foobar)
3515 foobar
   1 foobarError writing log message: thread killed (original message: foobar)
3438 foobar
   1 foError writing log message: thread killed (original message: foobar)
3400 foobar
   1 test: thread killed

This is because streamHandler catches all the exceptions, even async ones. This is totally discouraged and results in errors like this.

After my patch:

$ ghc -fforce-recomp --make test && ./test 2>&1 | uniq -c
[1 of 1] Compiling Main             ( test.hs, test.o )
Linking test ...
      1 test: thread killed

Please consider including this patch, thanks!

Further info: http://hackage.haskell.org/packages/archive/base/latest/doc/html/Control-Exception.html#g:4

closes #8