[PATCH v2] SecureSocket: use fallback function if bit_length is not available in Python