move fork detection before socket creation.

Actually move the line before socket creation.