Resolve pidfile resource leaks

This patch resolves resource leaks caused by not closing the file streams upon
an write error.
Silence the annoying "subdir-objects disabled" warning
Add travis-ci script
Skip deprecated g_type_init() for GLib 2.36