Put includes in alphabetical order

The library style is to start with the includes corresponding to the
current module and then the rest in alphabetical order. Some modules
have several header files (eg. ssl_internal.h).

The recently added error.h includes did not respect this convention and
this commit restores it. In some cases this is not possible just by
moving the error.h declarations. This commit fixes the pre-existing
order in these instances too.
diff --git a/library/debug.c b/library/debug.c
index 1f7c2a0..ae78a69 100644
--- a/library/debug.c
+++ b/library/debug.c
@@ -39,13 +39,12 @@
 #endif
 
 #include "mbedtls/debug.h"
+#include "mbedtls/error.h"
 
 #include <stdarg.h>
 #include <stdio.h>
 #include <string.h>
 
-#include "mbedtls/error.h"
-
 #if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
     !defined(inline) && !defined(__cplusplus)
 #define inline __inline
diff --git a/library/net_sockets.c b/library/net_sockets.c
index 1a88c22..dbde510 100644
--- a/library/net_sockets.c
+++ b/library/net_sockets.c
@@ -45,11 +45,10 @@
 #endif
 
 #include "mbedtls/net_sockets.h"
+#include "mbedtls/error.h"
 
 #include <string.h>
 
-#include "mbedtls/error.h"
-
 #if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(EFIX64) && \
     !defined(EFI32)
 
diff --git a/library/ssl_cli.c b/library/ssl_cli.c
index b632998..1005bd9 100644
--- a/library/ssl_cli.c
+++ b/library/ssl_cli.c
@@ -35,10 +35,10 @@
 #define mbedtls_free      free
 #endif
 
-#include "mbedtls/error.h"
-#include "mbedtls/debug.h"
 #include "mbedtls/ssl.h"
 #include "mbedtls/ssl_internal.h"
+#include "mbedtls/debug.h"
+#include "mbedtls/error.h"
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)
 #include "mbedtls/psa_util.h"
diff --git a/library/ssl_cookie.c b/library/ssl_cookie.c
index 1635832..4bf9058 100644
--- a/library/ssl_cookie.c
+++ b/library/ssl_cookie.c
@@ -38,9 +38,9 @@
 #define mbedtls_free      free
 #endif
 
-#include "mbedtls/error.h"
 #include "mbedtls/ssl_cookie.h"
 #include "mbedtls/ssl_internal.h"
+#include "mbedtls/error.h"
 #include "mbedtls/platform_util.h"
 
 #include <string.h>
diff --git a/library/ssl_srv.c b/library/ssl_srv.c
index ec65058..b0b09cd 100644
--- a/library/ssl_srv.c
+++ b/library/ssl_srv.c
@@ -35,10 +35,10 @@
 #define mbedtls_free      free
 #endif
 
-#include "mbedtls/error.h"
-#include "mbedtls/debug.h"
 #include "mbedtls/ssl.h"
 #include "mbedtls/ssl_internal.h"
+#include "mbedtls/debug.h"
+#include "mbedtls/error.h"
 #include "mbedtls/platform_util.h"
 
 #include <string.h>
diff --git a/library/ssl_ticket.c b/library/ssl_ticket.c
index a00dd4a..8a76b42 100644
--- a/library/ssl_ticket.c
+++ b/library/ssl_ticket.c
@@ -36,8 +36,8 @@
 #endif
 
 #include "mbedtls/ssl_ticket.h"
-#include "mbedtls/platform_util.h"
 #include "mbedtls/error.h"
+#include "mbedtls/platform_util.h"
 
 #include <string.h>
 
diff --git a/library/ssl_tls.c b/library/ssl_tls.c
index d42c222..6cf7781 100644
--- a/library/ssl_tls.c
+++ b/library/ssl_tls.c
@@ -43,10 +43,10 @@
 #define mbedtls_free      free
 #endif
 
-#include "mbedtls/error.h"
-#include "mbedtls/debug.h"
 #include "mbedtls/ssl.h"
 #include "mbedtls/ssl_internal.h"
+#include "mbedtls/debug.h"
+#include "mbedtls/error.h"
 #include "mbedtls/platform_util.h"
 #include "mbedtls/version.h"
 
diff --git a/library/x509.c b/library/x509.c
index f0d268a..7f8181b 100644
--- a/library/x509.c
+++ b/library/x509.c
@@ -35,12 +35,11 @@
 #include MBEDTLS_CONFIG_FILE
 #endif
 
-#include "mbedtls/error.h"
-
 #if defined(MBEDTLS_X509_USE_C)
 
 #include "mbedtls/x509.h"
 #include "mbedtls/asn1.h"
+#include "mbedtls/error.h"
 #include "mbedtls/oid.h"
 
 #include <stdio.h>
diff --git a/library/x509_create.c b/library/x509_create.c
index 661d104..7df2f0e 100644
--- a/library/x509_create.c
+++ b/library/x509_create.c
@@ -27,9 +27,9 @@
 
 #if defined(MBEDTLS_X509_CREATE_C)
 
-#include "mbedtls/error.h"
 #include "mbedtls/x509.h"
 #include "mbedtls/asn1write.h"
+#include "mbedtls/error.h"
 #include "mbedtls/oid.h"
 
 #include <string.h>
diff --git a/library/x509_crl.c b/library/x509_crl.c
index 8ff1be8..d1176fc 100644
--- a/library/x509_crl.c
+++ b/library/x509_crl.c
@@ -35,11 +35,10 @@
 #include MBEDTLS_CONFIG_FILE
 #endif
 
-#include "mbedtls/error.h"
-
 #if defined(MBEDTLS_X509_CRL_PARSE_C)
 
 #include "mbedtls/x509_crl.h"
+#include "mbedtls/error.h"
 #include "mbedtls/oid.h"
 #include "mbedtls/platform_util.h"
 
diff --git a/library/x509_crt.c b/library/x509_crt.c
index 191c886..38e69cc 100644
--- a/library/x509_crt.c
+++ b/library/x509_crt.c
@@ -37,11 +37,10 @@
 #include MBEDTLS_CONFIG_FILE
 #endif
 
-#include "mbedtls/error.h"
-
 #if defined(MBEDTLS_X509_CRT_PARSE_C)
 
 #include "mbedtls/x509_crt.h"
+#include "mbedtls/error.h"
 #include "mbedtls/oid.h"
 #include "mbedtls/platform_util.h"
 
diff --git a/library/x509_csr.c b/library/x509_csr.c
index d49fa12..7e2cfba 100644
--- a/library/x509_csr.c
+++ b/library/x509_csr.c
@@ -35,11 +35,10 @@
 #include MBEDTLS_CONFIG_FILE
 #endif
 
-#include "mbedtls/error.h"
-
 #if defined(MBEDTLS_X509_CSR_PARSE_C)
 
 #include "mbedtls/x509_csr.h"
+#include "mbedtls/error.h"
 #include "mbedtls/oid.h"
 #include "mbedtls/platform_util.h"
 
diff --git a/library/x509write_crt.c b/library/x509write_crt.c
index d844662..5947e43 100644
--- a/library/x509write_crt.c
+++ b/library/x509write_crt.c
@@ -31,15 +31,14 @@
 #include MBEDTLS_CONFIG_FILE
 #endif
 
-#include "mbedtls/error.h"
-
 #if defined(MBEDTLS_X509_CRT_WRITE_C)
 
 #include "mbedtls/x509_crt.h"
-#include "mbedtls/oid.h"
 #include "mbedtls/asn1write.h"
-#include "mbedtls/sha1.h"
+#include "mbedtls/error.h"
+#include "mbedtls/oid.h"
 #include "mbedtls/platform_util.h"
+#include "mbedtls/sha1.h"
 
 #include <string.h>
 
diff --git a/library/x509write_csr.c b/library/x509write_csr.c
index c93e4b4..0c3c396 100644
--- a/library/x509write_csr.c
+++ b/library/x509write_csr.c
@@ -30,13 +30,12 @@
 #include MBEDTLS_CONFIG_FILE
 #endif
 
-#include "mbedtls/error.h"
-
 #if defined(MBEDTLS_X509_CSR_WRITE_C)
 
 #include "mbedtls/x509_csr.h"
-#include "mbedtls/oid.h"
 #include "mbedtls/asn1write.h"
+#include "mbedtls/error.h"
+#include "mbedtls/oid.h"
 #include "mbedtls/platform_util.h"
 
 #if defined(MBEDTLS_USE_PSA_CRYPTO)