vmem: implementation of vmem_freespace()

Remove stub from function vmem_freespace() and implement this.
Fix space in UT vmem_out_of_memory.