buffer_erase: Don't decrease end_pos if it's 0