fix a few 64-bit warnings with socket code