core: free previous allocated variable if no more pkg to build rve struct
- cleaner shut down if not enough memory at startup
(cherry picked from commit ace56c6bd2221920b965185c1c9a5997cd3f2768)
(cherry picked from commit c5c1002be8c4f3e24d1b79b77856db2879b97c72)
Daniel-Constantin Mierla%!s(int64=11) %!d(string=hai) anos