Consume \n in mg_fgets when reading from membuf

Not consuming \n doesn't match fgets behavior and leads to infinite loop when password files are loaded from memory via mg_callbacks.open_file().