Use temporary directory for the socket

Make it possible for multiple users on the same machine to run bear at the same time without using the -s switch.

(This pull request is based on my other one, so the commit from there will also appear here.)