Minor GridFS changes

- Add return value to `gridfs_remove_filename`
- Add return value to `gridfile_writer_init` (which eventually should be meaningful)
- Stop writing when encountering an error
- In tests, Add macro for gridfs_init
- Minor refactoring and compilation fixes