seapp_contexts support for prefix matching on name

A package name specifed in seapp_contexts ending with a * will
perform a prefix match.

Ex)
name=com.test*

Will match:
com.test.me
com.test.foo.bar

Change-Id: I0dfb4584579945a7c444b40bb732d2d530dddb3a
Clean up some (void *) assignments.

Do casting when using the result of a malloc / realloc. This allows
this code to be compiled using c++, if needed.

Change-Id: I4f38b6747216548effb8b4edad77ee54de386a81