Preston North End twice come from behind to earn their first win in four Championship games with victory over lowly Sheffield Wednesday.