adapt paths for snap
I'm not 100% sure about this, but I think that we should limit ourselves to write files, sockets etc inside $SNAP folder (ie, avoid using /tmp).
Specially for the events socket, we should check for the $SNAP variable and if it exists, write and read the socket there.
Edited by Kali Kaneko