Simplify vectormem logic

Don't leak logic of freeing memory allocated by vec_malloc outside: instead, encapsulate it in corresponding vec_free function.

Needs review.