fixed null pointer crash when passing NULL to putsock/write_socket