Improve version parsing

Development versions have extra stuff in the form of
'version+distance-id'.

Let's assume we are already in the next major version when in
development.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Fix memfilectx API change

It will change in 3.1.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>