Potential buffer overwrite in pem_write_buffer() fixed

Length indication when given a too small buffer was off.
Added regression test in test_suite_pem to detect this.
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index d5b0512..0460c63 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -75,6 +75,7 @@
 add_test_suite(mdx)
 add_test_suite(mpi)
 add_test_suite(pbkdf2)
+add_test_suite(pem)
 add_test_suite(pkcs1_v21)
 add_test_suite(pkcs5)
 add_test_suite(pk)