Add missing argument checks

The APIs should validate their arguments and return an error value
(if possible), like NULL in this case. Situations like this should
NOT trigger asserts as it's not a logical error, it's simply a bad
input.
Fix inappropriate use of assert()

As stated in the previous commit, asserts should indicate a logical
error or some kind of internal bug and shouldn't be used for error
handling.

Therefore, get rid of asserts in sampgdk_invoke_native_array() and
print warnings instead. Also add some early asserts in init_plugin()
and cleanup_plugin().
Make log prefixes lowercase
Fix double newline in log messages

Looks like I broke this when tried to fix the absence of \n for
too long log messages.
Switch to array doubling algorithm

This allows us to automatically resize the array when an element
or multiple elements are removed with sampgdk_array_remove().
v4.0-beta2