JAVA-863: Added null checks in remove methods for GridFS.