Fix memleaks
Inline message queue initializer
Initialize pointers in alloc
Ensure mqueue is not reinitialized