Three-dimensional gauge dynamics from brane configurations with the (p, q)-fivebrane