Fix other occurrences of same bounds check issue

Security impact is the same: not triggerrable remotely except in very specific
use cases
diff --git a/library/pkwrite.c b/library/pkwrite.c
index 0a16eac..83b798c 100644
--- a/library/pkwrite.c
+++ b/library/pkwrite.c
@@ -96,7 +96,7 @@
         return( ret );
     }
 
-    if( *p - start < (int) len )
+    if( *p < start || (size_t)( *p - start ) < len )
         return( MBEDTLS_ERR_ASN1_BUF_TOO_SMALL );
 
     *p -= len;