Barnes & Noble swings to loss in Q1