JSONRPCServer, AirPlayServer, WebServer: listen on ipv6 if available, else fall back to ipv4

Rebased and squashed pull request #2668 as per @wsoltys request.

Re-tested on both OSX and linux OK, with and without ipv6 support in kernel : Airplay, Airtunes and Webserver all work OK.