Discuss the comprehensive security mechanisms implemented in Avalanche to mitigate potential threats such as double-spending and Sybil attacks.