create_local_socket(): Avoid code duplication.