This commit fixes the socket file name for Mac and Linux users.
Essentially, the port is now only concatenated to the socket name if it
is different than the default port.
This change was made to match with the specification of the PINE
protocol and the other emulators implementing it.
This fixes the following compiler deprecation warning
`warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.`