Add UID/GID parameters to the file_open function

This allows to specific the user and group as which the file should be
created or opened.
Add WITH_DEBUG Makefile option

This allows to switch more easily between release and debug CFLAGS.