Nonuniqueness in the inverse source problem in acoustics and electromagnetics