Fix namespace issue with bind(2), and also fix other socket operations just in case.